//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     ANTLR Version: 4.13.1
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// Generated from ../QueryCat.Backend/Parser/QueryCatParser.g4 by ANTLR 4.13.1

// Unreachable code detected
#pragma warning disable 0162
// The variable '...' is assigned but its value is never used
#pragma warning disable 0219
// Missing XML comment for publicly visible type or member '...'
#pragma warning disable 1591
// Ambiguous reference in cref attribute
#pragma warning disable 419

namespace QueryCat.Backend.Parser {
 #pragma warning disable 3021 
using System;
using System.IO;
using System.Text;
using System.Diagnostics;
using System.Collections.Generic;
using Antlr4.Runtime;
using Antlr4.Runtime.Atn;
using Antlr4.Runtime.Misc;
using Antlr4.Runtime.Tree;
using DFA = Antlr4.Runtime.Dfa.DFA;

[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.1")]
[System.CLSCompliant(false)]
public partial class QueryCatParser : Parser {
	protected static DFA[] decisionToDFA;
	protected static PredictionContextCache sharedContextCache = new PredictionContextCache();
	public const int
		LEFT_PAREN=1, RIGHT_PAREN=2, ASSIGN=3, ASSOCIATION=4, COLON=5, COMMA=6, 
		PERIOD=7, ELLIPSIS=8, SEMICOLON=9, QUESTION=10, LEFT_BRACKET=11, RIGHT_BRACKET=12, 
		LEFT_RIGHT_BRACKET=13, PIPE=14, AT_SIGN=15, EXCLAMATION_SIGN=16, DOLLAR_SIGN=17, 
		PLUS=18, MINUS=19, STAR=20, DIV=21, MOD=22, EQUALS=23, NOT_EQUALS=24, 
		GREATER=25, GREATER_OR_EQUALS=26, LESS=27, LESS_OR_EQUALS=28, CONCAT=29, 
		LESS_LESS=30, GREATER_GREATER=31, TYPECAST=32, ANY=33, BLOB=34, BOOL=35, 
		BOOLEAN=36, DECIMAL=37, FLOAT=38, INT=39, INT8=40, INTEGER=41, NUMERIC=42, 
		OBJECT=43, REAL=44, STRING=45, TEXT=46, TIMESTAMP=47, AND=48, AS=49, AT=50, 
		BEGIN=51, BY=52, CAST=53, DEFAULT=54, END=55, EXISTS=56, FALSE=57, FROM=58, 
		IN=59, IS=60, LIKE=61, LIKE_REGEX=62, NOT=63, NULL=64, ON=65, ONLY=66, 
		OR=67, SOME=68, TO=69, TRUE=70, USING=71, VOID=72, TRIM=73, LEADING=74, 
		TRAILING=75, BOTH=76, CURRENT_DATE=77, CURRENT_TIMESTAMP=78, INTERVAL=79, 
		YEAR=80, DOY=81, DAYOFYEAR=82, MONTH=83, DOW=84, WEEKDAY=85, DAY=86, HOUR=87, 
		MINUTE=88, SECOND=89, MILLISECOND=90, LOCAL=91, TIME=92, ZONE=93, CASE=94, 
		COALESCE=95, EXTRACT=96, POSITION=97, WHEN=98, OCCURRENCES_REGEX=99, SUBSTRING_REGEX=100, 
		POSITION_REGEX=101, TRANSLATE_REGEX=102, ECHO=103, ALL=104, ASC=105, BETWEEN=106, 
		CURRENT=107, DESC=108, DISTINCT=109, EXCEPT=110, FETCH=111, FIRST=112, 
		FOLLOWING=113, FORMAT=114, FULL=115, GROUP=116, HAVING=117, INNER=118, 
		INTERSECT=119, INTO=120, JOIN=121, LAST=122, LEFT=123, LIMIT=124, NEXT=125, 
		NULLS=126, OFFSET=127, ORDER=128, OUTER=129, OVER=130, PARTITION=131, 
		PRECEDING=132, RECURSIVE=133, RIGHT=134, ROW=135, ROWS=136, SELECT=137, 
		SIMILAR=138, TOP=139, UNBOUNDED=140, UNION=141, VALUES=142, WHERE=143, 
		WINDOW=144, WITH=145, UPDATE=146, INSERT=147, DECLARE=148, SET=149, CALL=150, 
		IF=151, THEN=152, ELSE=153, ELSEIF=154, WHILE=155, BREAK=156, CONTINUE=157, 
		FOR=158, TYPE=159, NO_QUOTES_IDENTIFIER=160, QUOTES_IDENTIFIER=161, INTEGER_LITERAL=162, 
		FLOAT_LITERAL=163, NUMERIC_LITERAL=164, STRING_LITERAL=165, BOOLEAN_LITERAL=166, 
		SINGLE_LINE_COMMENT=167, MULTILINE_COMMENT=168, SPACES=169;
	public const int
		RULE_program = 0, RULE_statement = 1, RULE_functionSignature = 2, RULE_functionType = 3, 
		RULE_functionArg = 4, RULE_functionCall = 5, RULE_functionCallArg = 6, 
		RULE_declareVariable = 7, RULE_setVariable = 8, RULE_selectStatement = 9, 
		RULE_selectOrderByClause = 10, RULE_selectSortSpecification = 11, RULE_selectAlias = 12, 
		RULE_selectQueryExpression = 13, RULE_selectQueryExpressionBody = 14, 
		RULE_selectQueryPrimary = 15, RULE_selectQuerySpecification = 16, RULE_selectList = 17, 
		RULE_selectExcept = 18, RULE_selectDistinctClause = 19, RULE_selectDistinctOnClause = 20, 
		RULE_selectWithClause = 21, RULE_selectWithElement = 22, RULE_selectWithColumnList = 23, 
		RULE_selectSublist = 24, RULE_selectTarget = 25, RULE_selectFromClause = 26, 
		RULE_selectTableReferenceList = 27, RULE_selectTableReference = 28, RULE_selectTableValuesRow = 29, 
		RULE_selectTableValues = 30, RULE_selectTablePrimary = 31, RULE_selectTableJoined = 32, 
		RULE_selectJoinType = 33, RULE_selectGroupBy = 34, RULE_selectHaving = 35, 
		RULE_selectSearchCondition = 36, RULE_selectWindowSpecification = 37, 
		RULE_selectWindowPartitionClause = 38, RULE_selectWindowOrderClause = 39, 
		RULE_selectWindow = 40, RULE_selectWindowDefinitionList = 41, RULE_selectOffsetClause = 42, 
		RULE_selectFetchFirstClause = 43, RULE_selectTopClause = 44, RULE_selectLimitClause = 45, 
		RULE_updateStatement = 46, RULE_updateSource = 47, RULE_updateSetClause = 48, 
		RULE_insertStatement = 49, RULE_insertToSource = 50, RULE_insertColumnsList = 51, 
		RULE_insertFromSource = 52, RULE_echoStatement = 53, RULE_callStatement = 54, 
		RULE_ifStatement = 55, RULE_ifCondition = 56, RULE_identifierSimple = 57, 
		RULE_identifier = 58, RULE_identifierSelector = 59, RULE_array = 60, RULE_intervalLiteral = 61, 
		RULE_blockExpression = 62, RULE_castOperand = 63, RULE_atTimeZone = 64, 
		RULE_caseExpression = 65, RULE_caseWhen = 66, RULE_standardFunction = 67, 
		RULE_dateTimeField = 68, RULE_type = 69, RULE_expression = 70, RULE_simpleExpression = 71, 
		RULE_literal = 72;
	public static readonly string[] ruleNames = {
		"program", "statement", "functionSignature", "functionType", "functionArg", 
		"functionCall", "functionCallArg", "declareVariable", "setVariable", "selectStatement", 
		"selectOrderByClause", "selectSortSpecification", "selectAlias", "selectQueryExpression", 
		"selectQueryExpressionBody", "selectQueryPrimary", "selectQuerySpecification", 
		"selectList", "selectExcept", "selectDistinctClause", "selectDistinctOnClause", 
		"selectWithClause", "selectWithElement", "selectWithColumnList", "selectSublist", 
		"selectTarget", "selectFromClause", "selectTableReferenceList", "selectTableReference", 
		"selectTableValuesRow", "selectTableValues", "selectTablePrimary", "selectTableJoined", 
		"selectJoinType", "selectGroupBy", "selectHaving", "selectSearchCondition", 
		"selectWindowSpecification", "selectWindowPartitionClause", "selectWindowOrderClause", 
		"selectWindow", "selectWindowDefinitionList", "selectOffsetClause", "selectFetchFirstClause", 
		"selectTopClause", "selectLimitClause", "updateStatement", "updateSource", 
		"updateSetClause", "insertStatement", "insertToSource", "insertColumnsList", 
		"insertFromSource", "echoStatement", "callStatement", "ifStatement", "ifCondition", 
		"identifierSimple", "identifier", "identifierSelector", "array", "intervalLiteral", 
		"blockExpression", "castOperand", "atTimeZone", "caseExpression", "caseWhen", 
		"standardFunction", "dateTimeField", "type", "expression", "simpleExpression", 
		"literal"
	};

	private static readonly string[] _LiteralNames = {
		null, "'('", "')'", "':='", "'=>'", "':'", "','", "'.'", "'...'", "';'", 
		"'?'", "'['", "']'", "'[]'", "'&>'", "'@'", "'!'", "'$'", "'+'", "'-'", 
		"'*'", "'/'", "'%'", "'='", "'<>'", "'>'", "'>='", "'<'", "'<='", "'||'", 
		"'<<'", "'>>'", "'::'", "'ANY'", "'BLOB'", "'BOOL'", "'BOOLEAN'", "'DECIMAL'", 
		"'FLOAT'", "'INT'", "'INT8'", "'INTEGER'", "'NUMERIC'", "'OBJECT'", "'REAL'", 
		"'STRING'", "'TEXT'", "'TIMESTAMP'", "'AND'", "'AS'", "'AT'", "'BEGIN'", 
		"'BY'", "'CAST'", "'DEFAULT'", "'END'", "'EXISTS'", "'FALSE'", "'FROM'", 
		"'IN'", "'IS'", "'LIKE'", "'LIKE_REGEX'", "'NOT'", "'NULL'", "'ON'", "'ONLY'", 
		"'OR'", "'SOME'", "'TO'", "'TRUE'", "'USING'", "'VOID'", "'TRIM'", "'LEADING'", 
		"'TRAILING'", "'BOTH'", "'CURRENT_DATE'", "'CURRENT_TIMESTAMP'", "'INTERVAL'", 
		"'YEAR'", "'DOY'", "'DAYOFYEAR'", "'MONTH'", "'DOW'", "'WEEKDAY'", "'DAY'", 
		"'HOUR'", "'MINUTE'", "'SECOND'", "'MILLISECOND'", "'LOCAL'", "'TIME'", 
		"'ZONE'", "'CASE'", "'COALESCE'", "'EXTRACT'", "'POSITION'", "'WHEN'", 
		"'OCCURRENCES_REGEX'", "'SUBSTRING_REGEX'", "'POSITION_REGEX'", "'TRANSLATE_REGEX'", 
		"'ECHO'", "'ALL'", "'ASC'", "'BETWEEN'", "'CURRENT'", "'DESC'", "'DISTINCT'", 
		"'EXCEPT'", "'FETCH'", "'FIRST'", "'FOLLOWING'", "'FORMAT'", "'FULL'", 
		"'GROUP'", "'HAVING'", "'INNER'", "'INTERSECT'", "'INTO'", "'JOIN'", "'LAST'", 
		"'LEFT'", "'LIMIT'", "'NEXT'", "'NULLS'", "'OFFSET'", "'ORDER'", "'OUTER'", 
		"'OVER'", "'PARTITION'", "'PRECEDING'", "'RECURSIVE'", "'RIGHT'", "'ROW'", 
		"'ROWS'", "'SELECT'", "'SIMILAR'", "'TOP'", "'UNBOUNDED'", "'UNION'", 
		"'VALUES'", "'WHERE'", "'WINDOW'", "'WITH'", "'UPDATE'", "'INSERT'", "'DECLARE'", 
		"'SET'", "'CALL'", "'IF'", "'THEN'", "'ELSE'", "'ELSEIF'", "'WHILE'", 
		"'BREAK'", "'CONTINUE'", "'FOR'"
	};
	private static readonly string[] _SymbolicNames = {
		null, "LEFT_PAREN", "RIGHT_PAREN", "ASSIGN", "ASSOCIATION", "COLON", "COMMA", 
		"PERIOD", "ELLIPSIS", "SEMICOLON", "QUESTION", "LEFT_BRACKET", "RIGHT_BRACKET", 
		"LEFT_RIGHT_BRACKET", "PIPE", "AT_SIGN", "EXCLAMATION_SIGN", "DOLLAR_SIGN", 
		"PLUS", "MINUS", "STAR", "DIV", "MOD", "EQUALS", "NOT_EQUALS", "GREATER", 
		"GREATER_OR_EQUALS", "LESS", "LESS_OR_EQUALS", "CONCAT", "LESS_LESS", 
		"GREATER_GREATER", "TYPECAST", "ANY", "BLOB", "BOOL", "BOOLEAN", "DECIMAL", 
		"FLOAT", "INT", "INT8", "INTEGER", "NUMERIC", "OBJECT", "REAL", "STRING", 
		"TEXT", "TIMESTAMP", "AND", "AS", "AT", "BEGIN", "BY", "CAST", "DEFAULT", 
		"END", "EXISTS", "FALSE", "FROM", "IN", "IS", "LIKE", "LIKE_REGEX", "NOT", 
		"NULL", "ON", "ONLY", "OR", "SOME", "TO", "TRUE", "USING", "VOID", "TRIM", 
		"LEADING", "TRAILING", "BOTH", "CURRENT_DATE", "CURRENT_TIMESTAMP", "INTERVAL", 
		"YEAR", "DOY", "DAYOFYEAR", "MONTH", "DOW", "WEEKDAY", "DAY", "HOUR", 
		"MINUTE", "SECOND", "MILLISECOND", "LOCAL", "TIME", "ZONE", "CASE", "COALESCE", 
		"EXTRACT", "POSITION", "WHEN", "OCCURRENCES_REGEX", "SUBSTRING_REGEX", 
		"POSITION_REGEX", "TRANSLATE_REGEX", "ECHO", "ALL", "ASC", "BETWEEN", 
		"CURRENT", "DESC", "DISTINCT", "EXCEPT", "FETCH", "FIRST", "FOLLOWING", 
		"FORMAT", "FULL", "GROUP", "HAVING", "INNER", "INTERSECT", "INTO", "JOIN", 
		"LAST", "LEFT", "LIMIT", "NEXT", "NULLS", "OFFSET", "ORDER", "OUTER", 
		"OVER", "PARTITION", "PRECEDING", "RECURSIVE", "RIGHT", "ROW", "ROWS", 
		"SELECT", "SIMILAR", "TOP", "UNBOUNDED", "UNION", "VALUES", "WHERE", "WINDOW", 
		"WITH", "UPDATE", "INSERT", "DECLARE", "SET", "CALL", "IF", "THEN", "ELSE", 
		"ELSEIF", "WHILE", "BREAK", "CONTINUE", "FOR", "TYPE", "NO_QUOTES_IDENTIFIER", 
		"QUOTES_IDENTIFIER", "INTEGER_LITERAL", "FLOAT_LITERAL", "NUMERIC_LITERAL", 
		"STRING_LITERAL", "BOOLEAN_LITERAL", "SINGLE_LINE_COMMENT", "MULTILINE_COMMENT", 
		"SPACES"
	};
	public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames);

	[NotNull]
	public override IVocabulary Vocabulary
	{
		get
		{
			return DefaultVocabulary;
		}
	}

	public override string GrammarFileName { get { return "QueryCatParser.g4"; } }

	public override string[] RuleNames { get { return ruleNames; } }

	public override int[] SerializedAtn { get { return _serializedATN; } }

	static QueryCatParser() {
		decisionToDFA = new DFA[_ATN.NumberOfDecisions];
		for (int i = 0; i < _ATN.NumberOfDecisions; i++) {
			decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i);
		}
	}

		public QueryCatParser(ITokenStream input) : this(input, Console.Out, Console.Error) { }

		public QueryCatParser(ITokenStream input, TextWriter output, TextWriter errorOutput)
		: base(input, output, errorOutput)
	{
		Interpreter = new ParserATNSimulator(this, _ATN, decisionToDFA, sharedContextCache);
	}

	public partial class ProgramContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public StatementContext[] statement() {
			return GetRuleContexts<StatementContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public StatementContext statement(int i) {
			return GetRuleContext<StatementContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode Eof() { return GetToken(QueryCatParser.Eof, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] SEMICOLON() { return GetTokens(QueryCatParser.SEMICOLON); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SEMICOLON(int i) {
			return GetToken(QueryCatParser.SEMICOLON, i);
		}
		public ProgramContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_program; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitProgram(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public ProgramContext program() {
		ProgramContext _localctx = new ProgramContext(Context, State);
		EnterRule(_localctx, 0, RULE_program);
		int _la;
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			State = 149;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==SEMICOLON) {
				{
				{
				State = 146;
				Match(SEMICOLON);
				}
				}
				State = 151;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			State = 152;
			statement();
			State = 157;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,1,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					{
					{
					State = 153;
					Match(SEMICOLON);
					State = 154;
					statement();
					}
					} 
				}
				State = 159;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,1,Context);
			}
			State = 163;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==SEMICOLON) {
				{
				{
				State = 160;
				Match(SEMICOLON);
				}
				}
				State = 165;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			State = 166;
			Match(Eof);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class StatementContext : ParserRuleContext {
		public StatementContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_statement; } }
	 
		public StatementContext() { }
		public virtual void CopyFrom(StatementContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class StatementIfContext : StatementContext {
		[System.Diagnostics.DebuggerNonUserCode] public IfStatementContext ifStatement() {
			return GetRuleContext<IfStatementContext>(0);
		}
		public StatementIfContext(StatementContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStatementIf(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StatementSelectExpressionContext : StatementContext {
		[System.Diagnostics.DebuggerNonUserCode] public SelectStatementContext selectStatement() {
			return GetRuleContext<SelectStatementContext>(0);
		}
		public StatementSelectExpressionContext(StatementContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStatementSelectExpression(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StatementEchoContext : StatementContext {
		[System.Diagnostics.DebuggerNonUserCode] public EchoStatementContext echoStatement() {
			return GetRuleContext<EchoStatementContext>(0);
		}
		public StatementEchoContext(StatementContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStatementEcho(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StatementExpressionContext : StatementContext {
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		public StatementExpressionContext(StatementContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStatementExpression(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StatementDeclareVariableContext : StatementContext {
		[System.Diagnostics.DebuggerNonUserCode] public DeclareVariableContext declareVariable() {
			return GetRuleContext<DeclareVariableContext>(0);
		}
		public StatementDeclareVariableContext(StatementContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStatementDeclareVariable(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StatementCallContext : StatementContext {
		[System.Diagnostics.DebuggerNonUserCode] public CallStatementContext callStatement() {
			return GetRuleContext<CallStatementContext>(0);
		}
		public StatementCallContext(StatementContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStatementCall(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StatementFunctionCallContext : StatementContext {
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall() {
			return GetRuleContext<FunctionCallContext>(0);
		}
		public StatementFunctionCallContext(StatementContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStatementFunctionCall(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StatementSetVariableContext : StatementContext {
		[System.Diagnostics.DebuggerNonUserCode] public SetVariableContext setVariable() {
			return GetRuleContext<SetVariableContext>(0);
		}
		public StatementSetVariableContext(StatementContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStatementSetVariable(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StatementUpdateExpressionContext : StatementContext {
		[System.Diagnostics.DebuggerNonUserCode] public UpdateStatementContext updateStatement() {
			return GetRuleContext<UpdateStatementContext>(0);
		}
		public StatementUpdateExpressionContext(StatementContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStatementUpdateExpression(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StatementInsertExpressionContext : StatementContext {
		[System.Diagnostics.DebuggerNonUserCode] public InsertStatementContext insertStatement() {
			return GetRuleContext<InsertStatementContext>(0);
		}
		public StatementInsertExpressionContext(StatementContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStatementInsertExpression(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public StatementContext statement() {
		StatementContext _localctx = new StatementContext(Context, State);
		EnterRule(_localctx, 2, RULE_statement);
		try {
			State = 178;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,3,Context) ) {
			case 1:
				_localctx = new StatementFunctionCallContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 168;
				functionCall();
				}
				break;
			case 2:
				_localctx = new StatementDeclareVariableContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 169;
				declareVariable();
				}
				break;
			case 3:
				_localctx = new StatementSetVariableContext(_localctx);
				EnterOuterAlt(_localctx, 3);
				{
				State = 170;
				setVariable();
				}
				break;
			case 4:
				_localctx = new StatementSelectExpressionContext(_localctx);
				EnterOuterAlt(_localctx, 4);
				{
				State = 171;
				selectStatement();
				}
				break;
			case 5:
				_localctx = new StatementUpdateExpressionContext(_localctx);
				EnterOuterAlt(_localctx, 5);
				{
				State = 172;
				updateStatement();
				}
				break;
			case 6:
				_localctx = new StatementInsertExpressionContext(_localctx);
				EnterOuterAlt(_localctx, 6);
				{
				State = 173;
				insertStatement();
				}
				break;
			case 7:
				_localctx = new StatementEchoContext(_localctx);
				EnterOuterAlt(_localctx, 7);
				{
				State = 174;
				echoStatement();
				}
				break;
			case 8:
				_localctx = new StatementCallContext(_localctx);
				EnterOuterAlt(_localctx, 8);
				{
				State = 175;
				callStatement();
				}
				break;
			case 9:
				_localctx = new StatementIfContext(_localctx);
				EnterOuterAlt(_localctx, 9);
				{
				State = 176;
				ifStatement();
				}
				break;
			case 10:
				_localctx = new StatementExpressionContext(_localctx);
				EnterOuterAlt(_localctx, 10);
				{
				State = 177;
				expression(0);
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class FunctionSignatureContext : ParserRuleContext {
		public IdentifierSimpleContext name;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode Eof() { return GetToken(QueryCatParser.Eof, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple() {
			return GetRuleContext<IdentifierSimpleContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public FunctionArgContext[] functionArg() {
			return GetRuleContexts<FunctionArgContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public FunctionArgContext functionArg(int i) {
			return GetRuleContext<FunctionArgContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COLON() { return GetToken(QueryCatParser.COLON, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public FunctionTypeContext functionType() {
			return GetRuleContext<FunctionTypeContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public FunctionSignatureContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_functionSignature; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitFunctionSignature(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public FunctionSignatureContext functionSignature() {
		FunctionSignatureContext _localctx = new FunctionSignatureContext(Context, State);
		EnterRule(_localctx, 4, RULE_functionSignature);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 180;
			_localctx.name = identifierSimple();
			State = 181;
			Match(LEFT_PAREN);
			State = 190;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==ELLIPSIS || _la==AT_SIGN || _la==NO_QUOTES_IDENTIFIER || _la==QUOTES_IDENTIFIER) {
				{
				State = 182;
				functionArg();
				State = 187;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				while (_la==COMMA) {
					{
					{
					State = 183;
					Match(COMMA);
					State = 184;
					functionArg();
					}
					}
					State = 189;
					ErrorHandler.Sync(this);
					_la = TokenStream.LA(1);
				}
				}
			}

			State = 192;
			Match(RIGHT_PAREN);
			State = 195;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==COLON) {
				{
				State = 193;
				Match(COLON);
				State = 194;
				functionType();
				}
			}

			State = 197;
			Match(Eof);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class FunctionTypeContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public TypeContext type() {
			return GetRuleContext<TypeContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LESS() { return GetToken(QueryCatParser.LESS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple() {
			return GetRuleContext<IdentifierSimpleContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode GREATER() { return GetToken(QueryCatParser.GREATER, 0); }
		public FunctionTypeContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_functionType; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitFunctionType(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public FunctionTypeContext functionType() {
		FunctionTypeContext _localctx = new FunctionTypeContext(Context, State);
		EnterRule(_localctx, 6, RULE_functionType);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 199;
			type();
			State = 204;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==LESS) {
				{
				State = 200;
				Match(LESS);
				State = 201;
				identifierSimple();
				State = 202;
				Match(GREATER);
				}
			}

			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class FunctionArgContext : ParserRuleContext {
		public IToken variadic;
		public IToken optional;
		public IToken isArray;
		public LiteralContext @default;
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple() {
			return GetRuleContext<IdentifierSimpleContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COLON() { return GetToken(QueryCatParser.COLON, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public FunctionTypeContext functionType() {
			return GetRuleContext<FunctionTypeContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ELLIPSIS() { return GetToken(QueryCatParser.ELLIPSIS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode QUESTION() { return GetToken(QueryCatParser.QUESTION, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_RIGHT_BRACKET() { return GetToken(QueryCatParser.LEFT_RIGHT_BRACKET, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode EQUALS() { return GetToken(QueryCatParser.EQUALS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGN() { return GetToken(QueryCatParser.ASSIGN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DEFAULT() { return GetToken(QueryCatParser.DEFAULT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public LiteralContext literal() {
			return GetRuleContext<LiteralContext>(0);
		}
		public FunctionArgContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_functionArg; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitFunctionArg(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public FunctionArgContext functionArg() {
		FunctionArgContext _localctx = new FunctionArgContext(Context, State);
		EnterRule(_localctx, 8, RULE_functionArg);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 207;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==ELLIPSIS) {
				{
				State = 206;
				_localctx.variadic = Match(ELLIPSIS);
				}
			}

			State = 209;
			identifierSimple();
			State = 211;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==QUESTION) {
				{
				State = 210;
				_localctx.optional = Match(QUESTION);
				}
			}

			State = 213;
			Match(COLON);
			State = 214;
			functionType();
			State = 216;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==LEFT_RIGHT_BRACKET) {
				{
				State = 215;
				_localctx.isArray = Match(LEFT_RIGHT_BRACKET);
				}
			}

			State = 220;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 18014398517870600L) != 0)) {
				{
				State = 218;
				_la = TokenStream.LA(1);
				if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 18014398517870600L) != 0)) ) {
				ErrorHandler.RecoverInline(this);
				}
				else {
					ErrorHandler.ReportMatch(this);
				    Consume();
				}
				State = 219;
				_localctx.@default = literal();
				}
			}

			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class FunctionCallContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple() {
			return GetRuleContext<IdentifierSimpleContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallArgContext[] functionCallArg() {
			return GetRuleContexts<FunctionCallArgContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallArgContext functionCallArg(int i) {
			return GetRuleContext<FunctionCallArgContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STAR() { return GetToken(QueryCatParser.STAR, 0); }
		public FunctionCallContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_functionCall; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitFunctionCall(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public FunctionCallContext functionCall() {
		FunctionCallContext _localctx = new FunctionCallContext(Context, State);
		EnterRule(_localctx, 10, RULE_functionCall);
		int _la;
		try {
			State = 241;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,14,Context) ) {
			case 1:
				EnterOuterAlt(_localctx, 1);
				{
				State = 222;
				identifierSimple();
				State = 223;
				Match(LEFT_PAREN);
				State = 232;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -8994814355764903934L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & 531502260801L) != 0) || ((((_la - 160)) & ~0x3f) == 0 && ((1L << (_la - 160)) & 127L) != 0)) {
					{
					State = 224;
					functionCallArg();
					State = 229;
					ErrorHandler.Sync(this);
					_la = TokenStream.LA(1);
					while (_la==COMMA) {
						{
						{
						State = 225;
						Match(COMMA);
						State = 226;
						functionCallArg();
						}
						}
						State = 231;
						ErrorHandler.Sync(this);
						_la = TokenStream.LA(1);
					}
					}
				}

				State = 234;
				Match(RIGHT_PAREN);
				}
				break;
			case 2:
				EnterOuterAlt(_localctx, 2);
				{
				State = 236;
				identifierSimple();
				State = 237;
				Match(LEFT_PAREN);
				State = 238;
				Match(STAR);
				State = 239;
				Match(RIGHT_PAREN);
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class FunctionCallArgContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple() {
			return GetRuleContext<IdentifierSimpleContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSOCIATION() { return GetToken(QueryCatParser.ASSOCIATION, 0); }
		public FunctionCallArgContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_functionCallArg; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitFunctionCallArg(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public FunctionCallArgContext functionCallArg() {
		FunctionCallArgContext _localctx = new FunctionCallArgContext(Context, State);
		EnterRule(_localctx, 12, RULE_functionCallArg);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 246;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,15,Context) ) {
			case 1:
				{
				State = 243;
				identifierSimple();
				State = 244;
				Match(ASSOCIATION);
				}
				break;
			}
			State = 248;
			expression(0);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class DeclareVariableContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DECLARE() { return GetToken(QueryCatParser.DECLARE, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple() {
			return GetRuleContext<IdentifierSimpleContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public TypeContext type() {
			return GetRuleContext<TypeContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGN() { return GetToken(QueryCatParser.ASSIGN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public StatementContext statement() {
			return GetRuleContext<StatementContext>(0);
		}
		public DeclareVariableContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_declareVariable; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitDeclareVariable(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public DeclareVariableContext declareVariable() {
		DeclareVariableContext _localctx = new DeclareVariableContext(Context, State);
		EnterRule(_localctx, 14, RULE_declareVariable);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 250;
			Match(DECLARE);
			State = 251;
			identifierSimple();
			State = 252;
			type();
			State = 255;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==ASSIGN) {
				{
				State = 253;
				Match(ASSIGN);
				State = 254;
				statement();
				}
			}

			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SetVariableContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SET() { return GetToken(QueryCatParser.SET, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext identifier() {
			return GetRuleContext<IdentifierContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGN() { return GetToken(QueryCatParser.ASSIGN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public StatementContext statement() {
			return GetRuleContext<StatementContext>(0);
		}
		public SetVariableContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_setVariable; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSetVariable(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SetVariableContext setVariable() {
		SetVariableContext _localctx = new SetVariableContext(Context, State);
		EnterRule(_localctx, 16, RULE_setVariable);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 257;
			Match(SET);
			State = 258;
			identifier();
			State = 259;
			Match(ASSIGN);
			State = 260;
			statement();
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectStatementContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionContext selectQueryExpression() {
			return GetRuleContext<SelectQueryExpressionContext>(0);
		}
		public SelectStatementContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectStatement; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectStatement(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectStatementContext selectStatement() {
		SelectStatementContext _localctx = new SelectStatementContext(Context, State);
		EnterRule(_localctx, 18, RULE_selectStatement);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 262;
			selectQueryExpression();
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectOrderByClauseContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ORDER() { return GetToken(QueryCatParser.ORDER, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BY() { return GetToken(QueryCatParser.BY, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectSortSpecificationContext[] selectSortSpecification() {
			return GetRuleContexts<SelectSortSpecificationContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectSortSpecificationContext selectSortSpecification(int i) {
			return GetRuleContext<SelectSortSpecificationContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectOrderByClauseContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectOrderByClause; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectOrderByClause(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectOrderByClauseContext selectOrderByClause() {
		SelectOrderByClauseContext _localctx = new SelectOrderByClauseContext(Context, State);
		EnterRule(_localctx, 20, RULE_selectOrderByClause);
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			State = 264;
			Match(ORDER);
			State = 265;
			Match(BY);
			State = 266;
			selectSortSpecification();
			State = 271;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,17,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					{
					{
					State = 267;
					Match(COMMA);
					State = 268;
					selectSortSpecification();
					}
					} 
				}
				State = 273;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,17,Context);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectSortSpecificationContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASC() { return GetToken(QueryCatParser.ASC, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DESC() { return GetToken(QueryCatParser.DESC, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NULLS() { return GetToken(QueryCatParser.NULLS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FIRST() { return GetToken(QueryCatParser.FIRST, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LAST() { return GetToken(QueryCatParser.LAST, 0); }
		public SelectSortSpecificationContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectSortSpecification; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectSortSpecification(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectSortSpecificationContext selectSortSpecification() {
		SelectSortSpecificationContext _localctx = new SelectSortSpecificationContext(Context, State);
		EnterRule(_localctx, 22, RULE_selectSortSpecification);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 274;
			expression(0);
			State = 276;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,18,Context) ) {
			case 1:
				{
				State = 275;
				_la = TokenStream.LA(1);
				if ( !(_la==ASC || _la==DESC) ) {
				ErrorHandler.RecoverInline(this);
				}
				else {
					ErrorHandler.ReportMatch(this);
				    Consume();
				}
				}
				break;
			}
			State = 282;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,19,Context) ) {
			case 1:
				{
				{
				State = 278;
				Match(NULLS);
				State = 279;
				Match(FIRST);
				}
				}
				break;
			case 2:
				{
				{
				State = 280;
				Match(NULLS);
				State = 281;
				Match(LAST);
				}
				}
				break;
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectAliasContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple() {
			return GetRuleContext<IdentifierSimpleContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING_LITERAL() { return GetToken(QueryCatParser.STRING_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode AS() { return GetToken(QueryCatParser.AS, 0); }
		public SelectAliasContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectAlias; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectAlias(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectAliasContext selectAlias() {
		SelectAliasContext _localctx = new SelectAliasContext(Context, State);
		EnterRule(_localctx, 24, RULE_selectAlias);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 285;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==AS) {
				{
				State = 284;
				Match(AS);
				}
			}

			State = 289;
			ErrorHandler.Sync(this);
			switch (TokenStream.LA(1)) {
			case AT_SIGN:
			case NO_QUOTES_IDENTIFIER:
			case QUOTES_IDENTIFIER:
				{
				State = 287;
				identifierSimple();
				}
				break;
			case STRING_LITERAL:
				{
				State = 288;
				Match(STRING_LITERAL);
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectQueryExpressionContext : ParserRuleContext {
		public SelectQueryExpressionContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectQueryExpression; } }
	 
		public SelectQueryExpressionContext() { }
		public virtual void CopyFrom(SelectQueryExpressionContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class SelectQueryExpressionSimpleContext : SelectQueryExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SELECT() { return GetToken(QueryCatParser.SELECT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectListContext selectList() {
			return GetRuleContext<SelectListContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectWithClauseContext selectWithClause() {
			return GetRuleContext<SelectWithClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectTopClauseContext selectTopClause() {
			return GetRuleContext<SelectTopClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectDistinctClauseContext selectDistinctClause() {
			return GetRuleContext<SelectDistinctClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectExceptContext selectExcept() {
			return GetRuleContext<SelectExceptContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectTargetContext selectTarget() {
			return GetRuleContext<SelectTargetContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectFromClauseContext selectFromClause() {
			return GetRuleContext<SelectFromClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectWindowContext selectWindow() {
			return GetRuleContext<SelectWindowContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectOrderByClauseContext selectOrderByClause() {
			return GetRuleContext<SelectOrderByClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectLimitClauseContext selectLimitClause() {
			return GetRuleContext<SelectLimitClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectOffsetClauseContext selectOffsetClause() {
			return GetRuleContext<SelectOffsetClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectFetchFirstClauseContext selectFetchFirstClause() {
			return GetRuleContext<SelectFetchFirstClauseContext>(0);
		}
		public SelectQueryExpressionSimpleContext(SelectQueryExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectQueryExpressionSimple(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectQueryExpressionFullContext : SelectQueryExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionBodyContext selectQueryExpressionBody() {
			return GetRuleContext<SelectQueryExpressionBodyContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectWithClauseContext selectWithClause() {
			return GetRuleContext<SelectWithClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectOrderByClauseContext selectOrderByClause() {
			return GetRuleContext<SelectOrderByClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectLimitClauseContext selectLimitClause() {
			return GetRuleContext<SelectLimitClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectOffsetClauseContext selectOffsetClause() {
			return GetRuleContext<SelectOffsetClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectFetchFirstClauseContext selectFetchFirstClause() {
			return GetRuleContext<SelectFetchFirstClauseContext>(0);
		}
		public SelectQueryExpressionFullContext(SelectQueryExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectQueryExpressionFull(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectQueryExpressionContext selectQueryExpression() {
		SelectQueryExpressionContext _localctx = new SelectQueryExpressionContext(Context, State);
		EnterRule(_localctx, 26, RULE_selectQueryExpression);
		int _la;
		try {
			State = 342;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,38,Context) ) {
			case 1:
				_localctx = new SelectQueryExpressionSimpleContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 292;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (_la==WITH) {
					{
					State = 291;
					selectWithClause();
					}
				}

				State = 294;
				Match(SELECT);
				State = 296;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (_la==TOP) {
					{
					State = 295;
					selectTopClause();
					}
				}

				State = 299;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (_la==ALL || _la==DISTINCT) {
					{
					State = 298;
					selectDistinctClause();
					}
				}

				State = 301;
				selectList();
				State = 303;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,25,Context) ) {
				case 1:
					{
					State = 302;
					selectExcept();
					}
					break;
				}
				State = 306;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,26,Context) ) {
				case 1:
					{
					State = 305;
					selectTarget();
					}
					break;
				}
				State = 309;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,27,Context) ) {
				case 1:
					{
					State = 308;
					selectFromClause();
					}
					break;
				}
				State = 312;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,28,Context) ) {
				case 1:
					{
					State = 311;
					selectWindow();
					}
					break;
				}
				State = 315;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,29,Context) ) {
				case 1:
					{
					State = 314;
					selectOrderByClause();
					}
					break;
				}
				State = 318;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,30,Context) ) {
				case 1:
					{
					State = 317;
					selectLimitClause();
					}
					break;
				}
				State = 321;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,31,Context) ) {
				case 1:
					{
					State = 320;
					selectOffsetClause();
					}
					break;
				}
				State = 324;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,32,Context) ) {
				case 1:
					{
					State = 323;
					selectFetchFirstClause();
					}
					break;
				}
				}
				break;
			case 2:
				_localctx = new SelectQueryExpressionFullContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 327;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,33,Context) ) {
				case 1:
					{
					State = 326;
					selectWithClause();
					}
					break;
				}
				State = 329;
				selectQueryExpressionBody(0);
				State = 331;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,34,Context) ) {
				case 1:
					{
					State = 330;
					selectOrderByClause();
					}
					break;
				}
				State = 334;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,35,Context) ) {
				case 1:
					{
					State = 333;
					selectLimitClause();
					}
					break;
				}
				State = 337;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,36,Context) ) {
				case 1:
					{
					State = 336;
					selectOffsetClause();
					}
					break;
				}
				State = 340;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,37,Context) ) {
				case 1:
					{
					State = 339;
					selectFetchFirstClause();
					}
					break;
				}
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectQueryExpressionBodyContext : ParserRuleContext {
		public SelectQueryExpressionBodyContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectQueryExpressionBody; } }
	 
		public SelectQueryExpressionBodyContext() { }
		public virtual void CopyFrom(SelectQueryExpressionBodyContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class SelectQueryExpressionBodyUnionExceptContext : SelectQueryExpressionBodyContext {
		public SelectQueryExpressionBodyContext left;
		public SelectQueryExpressionBodyContext right;
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionBodyContext[] selectQueryExpressionBody() {
			return GetRuleContexts<SelectQueryExpressionBodyContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionBodyContext selectQueryExpressionBody(int i) {
			return GetRuleContext<SelectQueryExpressionBodyContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode UNION() { return GetToken(QueryCatParser.UNION, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode EXCEPT() { return GetToken(QueryCatParser.EXCEPT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DISTINCT() { return GetToken(QueryCatParser.DISTINCT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ALL() { return GetToken(QueryCatParser.ALL, 0); }
		public SelectQueryExpressionBodyUnionExceptContext(SelectQueryExpressionBodyContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectQueryExpressionBodyUnionExcept(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectQueryExpressionBodyIntersectContext : SelectQueryExpressionBodyContext {
		public SelectQueryExpressionBodyContext left;
		public SelectQueryExpressionBodyContext right;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INTERSECT() { return GetToken(QueryCatParser.INTERSECT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionBodyContext[] selectQueryExpressionBody() {
			return GetRuleContexts<SelectQueryExpressionBodyContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionBodyContext selectQueryExpressionBody(int i) {
			return GetRuleContext<SelectQueryExpressionBodyContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DISTINCT() { return GetToken(QueryCatParser.DISTINCT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ALL() { return GetToken(QueryCatParser.ALL, 0); }
		public SelectQueryExpressionBodyIntersectContext(SelectQueryExpressionBodyContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectQueryExpressionBodyIntersect(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectQueryExpressionBodyPrimaryContext : SelectQueryExpressionBodyContext {
		public SelectQueryPrimaryContext left;
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryPrimaryContext selectQueryPrimary() {
			return GetRuleContext<SelectQueryPrimaryContext>(0);
		}
		public SelectQueryExpressionBodyPrimaryContext(SelectQueryExpressionBodyContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectQueryExpressionBodyPrimary(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectQueryExpressionBodyContext selectQueryExpressionBody() {
		return selectQueryExpressionBody(0);
	}

	private SelectQueryExpressionBodyContext selectQueryExpressionBody(int _p) {
		ParserRuleContext _parentctx = Context;
		int _parentState = State;
		SelectQueryExpressionBodyContext _localctx = new SelectQueryExpressionBodyContext(Context, _parentState);
		SelectQueryExpressionBodyContext _prevctx = _localctx;
		int _startState = 28;
		EnterRecursionRule(_localctx, 28, RULE_selectQueryExpressionBody, _p);
		int _la;
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			{
			_localctx = new SelectQueryExpressionBodyPrimaryContext(_localctx);
			Context = _localctx;
			_prevctx = _localctx;

			State = 345;
			((SelectQueryExpressionBodyPrimaryContext)_localctx).left = selectQueryPrimary();
			}
			Context.Stop = TokenStream.LT(-1);
			State = 361;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,42,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					if ( ParseListeners!=null )
						TriggerExitRuleEvent();
					_prevctx = _localctx;
					{
					State = 359;
					ErrorHandler.Sync(this);
					switch ( Interpreter.AdaptivePredict(TokenStream,41,Context) ) {
					case 1:
						{
						_localctx = new SelectQueryExpressionBodyIntersectContext(new SelectQueryExpressionBodyContext(_parentctx, _parentState));
						((SelectQueryExpressionBodyIntersectContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_selectQueryExpressionBody);
						State = 347;
						if (!(Precpred(Context, 2))) throw new FailedPredicateException(this, "Precpred(Context, 2)");
						State = 348;
						Match(INTERSECT);
						State = 350;
						ErrorHandler.Sync(this);
						_la = TokenStream.LA(1);
						if (_la==ALL || _la==DISTINCT) {
							{
							State = 349;
							_la = TokenStream.LA(1);
							if ( !(_la==ALL || _la==DISTINCT) ) {
							ErrorHandler.RecoverInline(this);
							}
							else {
								ErrorHandler.ReportMatch(this);
							    Consume();
							}
							}
						}

						State = 352;
						((SelectQueryExpressionBodyIntersectContext)_localctx).right = selectQueryExpressionBody(3);
						}
						break;
					case 2:
						{
						_localctx = new SelectQueryExpressionBodyUnionExceptContext(new SelectQueryExpressionBodyContext(_parentctx, _parentState));
						((SelectQueryExpressionBodyUnionExceptContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_selectQueryExpressionBody);
						State = 353;
						if (!(Precpred(Context, 1))) throw new FailedPredicateException(this, "Precpred(Context, 1)");
						State = 354;
						_la = TokenStream.LA(1);
						if ( !(_la==EXCEPT || _la==UNION) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
							ErrorHandler.ReportMatch(this);
						    Consume();
						}
						State = 356;
						ErrorHandler.Sync(this);
						_la = TokenStream.LA(1);
						if (_la==ALL || _la==DISTINCT) {
							{
							State = 355;
							_la = TokenStream.LA(1);
							if ( !(_la==ALL || _la==DISTINCT) ) {
							ErrorHandler.RecoverInline(this);
							}
							else {
								ErrorHandler.ReportMatch(this);
							    Consume();
							}
							}
						}

						State = 358;
						((SelectQueryExpressionBodyUnionExceptContext)_localctx).right = selectQueryExpressionBody(2);
						}
						break;
					}
					} 
				}
				State = 363;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,42,Context);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			UnrollRecursionContexts(_parentctx);
		}
		return _localctx;
	}

	public partial class SelectQueryPrimaryContext : ParserRuleContext {
		public SelectQueryPrimaryContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectQueryPrimary; } }
	 
		public SelectQueryPrimaryContext() { }
		public virtual void CopyFrom(SelectQueryPrimaryContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class SelectQueryPrimaryNoParensContext : SelectQueryPrimaryContext {
		[System.Diagnostics.DebuggerNonUserCode] public SelectQuerySpecificationContext selectQuerySpecification() {
			return GetRuleContext<SelectQuerySpecificationContext>(0);
		}
		public SelectQueryPrimaryNoParensContext(SelectQueryPrimaryContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectQueryPrimaryNoParens(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectQueryPrimaryParensContext : SelectQueryPrimaryContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionContext selectQueryExpression() {
			return GetRuleContext<SelectQueryExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		public SelectQueryPrimaryParensContext(SelectQueryPrimaryContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectQueryPrimaryParens(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectQueryPrimaryContext selectQueryPrimary() {
		SelectQueryPrimaryContext _localctx = new SelectQueryPrimaryContext(Context, State);
		EnterRule(_localctx, 30, RULE_selectQueryPrimary);
		try {
			State = 369;
			ErrorHandler.Sync(this);
			switch (TokenStream.LA(1)) {
			case SELECT:
			case WITH:
				_localctx = new SelectQueryPrimaryNoParensContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 364;
				selectQuerySpecification();
				}
				break;
			case LEFT_PAREN:
				_localctx = new SelectQueryPrimaryParensContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 365;
				Match(LEFT_PAREN);
				State = 366;
				selectQueryExpression();
				State = 367;
				Match(RIGHT_PAREN);
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectQuerySpecificationContext : ParserRuleContext {
		public SelectQuerySpecificationContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectQuerySpecification; } }
	 
		public SelectQuerySpecificationContext() { }
		public virtual void CopyFrom(SelectQuerySpecificationContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class SelectQuerySpecificationSingleContext : SelectQuerySpecificationContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SELECT() { return GetToken(QueryCatParser.SELECT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectSublistContext[] selectSublist() {
			return GetRuleContexts<SelectSublistContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectSublistContext selectSublist(int i) {
			return GetRuleContext<SelectSublistContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectTargetContext selectTarget() {
			return GetRuleContext<SelectTargetContext>(0);
		}
		public SelectQuerySpecificationSingleContext(SelectQuerySpecificationContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectQuerySpecificationSingle(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectQuerySpecificationFullContext : SelectQuerySpecificationContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SELECT() { return GetToken(QueryCatParser.SELECT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectListContext selectList() {
			return GetRuleContext<SelectListContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectFromClauseContext selectFromClause() {
			return GetRuleContext<SelectFromClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectWithClauseContext selectWithClause() {
			return GetRuleContext<SelectWithClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectTopClauseContext selectTopClause() {
			return GetRuleContext<SelectTopClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectDistinctClauseContext selectDistinctClause() {
			return GetRuleContext<SelectDistinctClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectExceptContext selectExcept() {
			return GetRuleContext<SelectExceptContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectTargetContext selectTarget() {
			return GetRuleContext<SelectTargetContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectWindowContext selectWindow() {
			return GetRuleContext<SelectWindowContext>(0);
		}
		public SelectQuerySpecificationFullContext(SelectQuerySpecificationContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectQuerySpecificationFull(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectQuerySpecificationContext selectQuerySpecification() {
		SelectQuerySpecificationContext _localctx = new SelectQuerySpecificationContext(Context, State);
		EnterRule(_localctx, 32, RULE_selectQuerySpecification);
		int _la;
		try {
			int _alt;
			State = 404;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,52,Context) ) {
			case 1:
				_localctx = new SelectQuerySpecificationFullContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 372;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (_la==WITH) {
					{
					State = 371;
					selectWithClause();
					}
				}

				State = 374;
				Match(SELECT);
				State = 376;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (_la==TOP) {
					{
					State = 375;
					selectTopClause();
					}
				}

				State = 379;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (_la==ALL || _la==DISTINCT) {
					{
					State = 378;
					selectDistinctClause();
					}
				}

				State = 381;
				selectList();
				State = 383;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (_la==EXCEPT) {
					{
					State = 382;
					selectExcept();
					}
				}

				State = 386;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (_la==INTO) {
					{
					State = 385;
					selectTarget();
					}
				}

				State = 388;
				selectFromClause();
				State = 390;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,49,Context) ) {
				case 1:
					{
					State = 389;
					selectWindow();
					}
					break;
				}
				}
				break;
			case 2:
				_localctx = new SelectQuerySpecificationSingleContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 392;
				Match(SELECT);
				State = 393;
				selectSublist();
				State = 398;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,50,Context);
				while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
					if ( _alt==1 ) {
						{
						{
						State = 394;
						Match(COMMA);
						State = 395;
						selectSublist();
						}
						} 
					}
					State = 400;
					ErrorHandler.Sync(this);
					_alt = Interpreter.AdaptivePredict(TokenStream,50,Context);
				}
				State = 402;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,51,Context) ) {
				case 1:
					{
					State = 401;
					selectTarget();
					}
					break;
				}
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectListContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public SelectSublistContext[] selectSublist() {
			return GetRuleContexts<SelectSublistContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectSublistContext selectSublist(int i) {
			return GetRuleContext<SelectSublistContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectListContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectList; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectList(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectListContext selectList() {
		SelectListContext _localctx = new SelectListContext(Context, State);
		EnterRule(_localctx, 34, RULE_selectList);
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			State = 406;
			selectSublist();
			State = 411;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,53,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					{
					{
					State = 407;
					Match(COMMA);
					State = 408;
					selectSublist();
					}
					} 
				}
				State = 413;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,53,Context);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectExceptContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode EXCEPT() { return GetToken(QueryCatParser.EXCEPT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext[] identifierSimple() {
			return GetRuleContexts<IdentifierSimpleContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple(int i) {
			return GetRuleContext<IdentifierSimpleContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectExceptContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectExcept; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectExcept(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectExceptContext selectExcept() {
		SelectExceptContext _localctx = new SelectExceptContext(Context, State);
		EnterRule(_localctx, 36, RULE_selectExcept);
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			State = 414;
			Match(EXCEPT);
			State = 415;
			identifierSimple();
			State = 420;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,54,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					{
					{
					State = 416;
					Match(COMMA);
					State = 417;
					identifierSimple();
					}
					} 
				}
				State = 422;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,54,Context);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectDistinctClauseContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ALL() { return GetToken(QueryCatParser.ALL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DISTINCT() { return GetToken(QueryCatParser.DISTINCT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectDistinctOnClauseContext selectDistinctOnClause() {
			return GetRuleContext<SelectDistinctOnClauseContext>(0);
		}
		public SelectDistinctClauseContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectDistinctClause; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectDistinctClause(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectDistinctClauseContext selectDistinctClause() {
		SelectDistinctClauseContext _localctx = new SelectDistinctClauseContext(Context, State);
		EnterRule(_localctx, 38, RULE_selectDistinctClause);
		try {
			State = 426;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,55,Context) ) {
			case 1:
				EnterOuterAlt(_localctx, 1);
				{
				State = 423;
				Match(ALL);
				}
				break;
			case 2:
				EnterOuterAlt(_localctx, 2);
				{
				State = 424;
				Match(DISTINCT);
				}
				break;
			case 3:
				EnterOuterAlt(_localctx, 3);
				{
				State = 425;
				selectDistinctOnClause();
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectDistinctOnClauseContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DISTINCT() { return GetToken(QueryCatParser.DISTINCT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ON() { return GetToken(QueryCatParser.ON, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext[] simpleExpression() {
			return GetRuleContexts<SimpleExpressionContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression(int i) {
			return GetRuleContext<SimpleExpressionContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectDistinctOnClauseContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectDistinctOnClause; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectDistinctOnClause(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectDistinctOnClauseContext selectDistinctOnClause() {
		SelectDistinctOnClauseContext _localctx = new SelectDistinctOnClauseContext(Context, State);
		EnterRule(_localctx, 40, RULE_selectDistinctOnClause);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 428;
			Match(DISTINCT);
			State = 429;
			Match(ON);
			State = 430;
			Match(LEFT_PAREN);
			State = 431;
			simpleExpression(0);
			State = 436;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==COMMA) {
				{
				{
				State = 432;
				Match(COMMA);
				State = 433;
				simpleExpression(0);
				}
				}
				State = 438;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			State = 439;
			Match(RIGHT_PAREN);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectWithClauseContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WITH() { return GetToken(QueryCatParser.WITH, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectWithElementContext[] selectWithElement() {
			return GetRuleContexts<SelectWithElementContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectWithElementContext selectWithElement(int i) {
			return GetRuleContext<SelectWithElementContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RECURSIVE() { return GetToken(QueryCatParser.RECURSIVE, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectWithClauseContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectWithClause; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectWithClause(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectWithClauseContext selectWithClause() {
		SelectWithClauseContext _localctx = new SelectWithClauseContext(Context, State);
		EnterRule(_localctx, 42, RULE_selectWithClause);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 441;
			Match(WITH);
			State = 443;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==RECURSIVE) {
				{
				State = 442;
				Match(RECURSIVE);
				}
			}

			State = 445;
			selectWithElement();
			State = 450;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==COMMA) {
				{
				{
				State = 446;
				Match(COMMA);
				State = 447;
				selectWithElement();
				}
				}
				State = 452;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectWithElementContext : ParserRuleContext {
		public IdentifierSimpleContext name;
		public SelectQueryExpressionContext query;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode AS() { return GetToken(QueryCatParser.AS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] LEFT_PAREN() { return GetTokens(QueryCatParser.LEFT_PAREN); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN(int i) {
			return GetToken(QueryCatParser.LEFT_PAREN, i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] RIGHT_PAREN() { return GetTokens(QueryCatParser.RIGHT_PAREN); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN(int i) {
			return GetToken(QueryCatParser.RIGHT_PAREN, i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple() {
			return GetRuleContext<IdentifierSimpleContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionContext selectQueryExpression() {
			return GetRuleContext<SelectQueryExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectWithColumnListContext selectWithColumnList() {
			return GetRuleContext<SelectWithColumnListContext>(0);
		}
		public SelectWithElementContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectWithElement; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectWithElement(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectWithElementContext selectWithElement() {
		SelectWithElementContext _localctx = new SelectWithElementContext(Context, State);
		EnterRule(_localctx, 44, RULE_selectWithElement);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 453;
			_localctx.name = identifierSimple();
			State = 458;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==LEFT_PAREN) {
				{
				State = 454;
				Match(LEFT_PAREN);
				State = 455;
				selectWithColumnList();
				State = 456;
				Match(RIGHT_PAREN);
				}
			}

			State = 460;
			Match(AS);
			State = 461;
			Match(LEFT_PAREN);
			State = 462;
			_localctx.query = selectQueryExpression();
			State = 463;
			Match(RIGHT_PAREN);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectWithColumnListContext : ParserRuleContext {
		public IdentifierContext name;
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext[] identifier() {
			return GetRuleContexts<IdentifierContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext identifier(int i) {
			return GetRuleContext<IdentifierContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectWithColumnListContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectWithColumnList; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectWithColumnList(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectWithColumnListContext selectWithColumnList() {
		SelectWithColumnListContext _localctx = new SelectWithColumnListContext(Context, State);
		EnterRule(_localctx, 46, RULE_selectWithColumnList);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 465;
			_localctx.name = identifier();
			State = 470;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==COMMA) {
				{
				{
				State = 466;
				Match(COMMA);
				State = 467;
				_localctx.name = identifier();
				}
				}
				State = 472;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectSublistContext : ParserRuleContext {
		public SelectSublistContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectSublist; } }
	 
		public SelectSublistContext() { }
		public virtual void CopyFrom(SelectSublistContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class SelectSublistExpressionContext : SelectSublistContext {
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectAliasContext selectAlias() {
			return GetRuleContext<SelectAliasContext>(0);
		}
		public SelectSublistExpressionContext(SelectSublistContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectSublistExpression(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectSublistWindowContext : SelectSublistContext {
		public IdentifierSimpleContext windowName;
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall() {
			return GetRuleContext<FunctionCallContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode OVER() { return GetToken(QueryCatParser.OVER, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectWindowSpecificationContext selectWindowSpecification() {
			return GetRuleContext<SelectWindowSpecificationContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple() {
			return GetRuleContext<IdentifierSimpleContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectAliasContext selectAlias() {
			return GetRuleContext<SelectAliasContext>(0);
		}
		public SelectSublistWindowContext(SelectSublistContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectSublistWindow(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectSublistAllContext : SelectSublistContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STAR() { return GetToken(QueryCatParser.STAR, 0); }
		public SelectSublistAllContext(SelectSublistContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectSublistAll(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectSublistContext selectSublist() {
		SelectSublistContext _localctx = new SelectSublistContext(Context, State);
		EnterRule(_localctx, 48, RULE_selectSublist);
		try {
			State = 487;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,64,Context) ) {
			case 1:
				_localctx = new SelectSublistAllContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 473;
				Match(STAR);
				}
				break;
			case 2:
				_localctx = new SelectSublistWindowContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 474;
				functionCall();
				State = 475;
				Match(OVER);
				State = 478;
				ErrorHandler.Sync(this);
				switch (TokenStream.LA(1)) {
				case AT_SIGN:
				case NO_QUOTES_IDENTIFIER:
				case QUOTES_IDENTIFIER:
					{
					State = 476;
					((SelectSublistWindowContext)_localctx).windowName = identifierSimple();
					}
					break;
				case LEFT_PAREN:
					{
					State = 477;
					selectWindowSpecification();
					}
					break;
				default:
					throw new NoViableAltException(this);
				}
				State = 481;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,62,Context) ) {
				case 1:
					{
					State = 480;
					selectAlias();
					}
					break;
				}
				}
				break;
			case 3:
				_localctx = new SelectSublistExpressionContext(_localctx);
				EnterOuterAlt(_localctx, 3);
				{
				State = 483;
				expression(0);
				State = 485;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,63,Context) ) {
				case 1:
					{
					State = 484;
					selectAlias();
					}
					break;
				}
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectTargetContext : ParserRuleContext {
		public FunctionCallContext into;
		public IToken uri;
		public FunctionCallContext format;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INTO() { return GetToken(QueryCatParser.INTO, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext[] functionCall() {
			return GetRuleContexts<FunctionCallContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall(int i) {
			return GetRuleContext<FunctionCallContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING_LITERAL() { return GetToken(QueryCatParser.STRING_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FORMAT() { return GetToken(QueryCatParser.FORMAT, 0); }
		public SelectTargetContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectTarget; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTarget(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectTargetContext selectTarget() {
		SelectTargetContext _localctx = new SelectTargetContext(Context, State);
		EnterRule(_localctx, 50, RULE_selectTarget);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 489;
			Match(INTO);
			State = 492;
			ErrorHandler.Sync(this);
			switch (TokenStream.LA(1)) {
			case AT_SIGN:
			case NO_QUOTES_IDENTIFIER:
			case QUOTES_IDENTIFIER:
				{
				State = 490;
				_localctx.into = functionCall();
				}
				break;
			case STRING_LITERAL:
				{
				State = 491;
				_localctx.uri = Match(STRING_LITERAL);
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
			State = 496;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,66,Context) ) {
			case 1:
				{
				State = 494;
				Match(FORMAT);
				State = 495;
				_localctx.format = functionCall();
				}
				break;
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectFromClauseContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public SelectTableReferenceListContext selectTableReferenceList() {
			return GetRuleContext<SelectTableReferenceListContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectSearchConditionContext selectSearchCondition() {
			return GetRuleContext<SelectSearchConditionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectGroupByContext selectGroupBy() {
			return GetRuleContext<SelectGroupByContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectHavingContext selectHaving() {
			return GetRuleContext<SelectHavingContext>(0);
		}
		public SelectFromClauseContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectFromClause; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectFromClause(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectFromClauseContext selectFromClause() {
		SelectFromClauseContext _localctx = new SelectFromClauseContext(Context, State);
		EnterRule(_localctx, 52, RULE_selectFromClause);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 498;
			selectTableReferenceList();
			State = 500;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,67,Context) ) {
			case 1:
				{
				State = 499;
				selectSearchCondition();
				}
				break;
			}
			State = 503;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,68,Context) ) {
			case 1:
				{
				State = 502;
				selectGroupBy();
				}
				break;
			}
			State = 506;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,69,Context) ) {
			case 1:
				{
				State = 505;
				selectHaving();
				}
				break;
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectTableReferenceListContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FROM() { return GetToken(QueryCatParser.FROM, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectTableReferenceContext[] selectTableReference() {
			return GetRuleContexts<SelectTableReferenceContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectTableReferenceContext selectTableReference(int i) {
			return GetRuleContext<SelectTableReferenceContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectTableReferenceListContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectTableReferenceList; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTableReferenceList(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectTableReferenceListContext selectTableReferenceList() {
		SelectTableReferenceListContext _localctx = new SelectTableReferenceListContext(Context, State);
		EnterRule(_localctx, 54, RULE_selectTableReferenceList);
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			State = 508;
			Match(FROM);
			State = 509;
			selectTableReference();
			State = 514;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,70,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					{
					{
					State = 510;
					Match(COMMA);
					State = 511;
					selectTableReference();
					}
					} 
				}
				State = 516;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,70,Context);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectTableReferenceContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public SelectTablePrimaryContext selectTablePrimary() {
			return GetRuleContext<SelectTablePrimaryContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectTableJoinedContext[] selectTableJoined() {
			return GetRuleContexts<SelectTableJoinedContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectTableJoinedContext selectTableJoined(int i) {
			return GetRuleContext<SelectTableJoinedContext>(i);
		}
		public SelectTableReferenceContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectTableReference; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTableReference(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectTableReferenceContext selectTableReference() {
		SelectTableReferenceContext _localctx = new SelectTableReferenceContext(Context, State);
		EnterRule(_localctx, 56, RULE_selectTableReference);
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			State = 517;
			selectTablePrimary();
			State = 521;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,71,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					{
					{
					State = 518;
					selectTableJoined();
					}
					} 
				}
				State = 523;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,71,Context);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectTableValuesRowContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext[] simpleExpression() {
			return GetRuleContexts<SimpleExpressionContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression(int i) {
			return GetRuleContext<SimpleExpressionContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectTableValuesRowContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectTableValuesRow; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTableValuesRow(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectTableValuesRowContext selectTableValuesRow() {
		SelectTableValuesRowContext _localctx = new SelectTableValuesRowContext(Context, State);
		EnterRule(_localctx, 58, RULE_selectTableValuesRow);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 524;
			Match(LEFT_PAREN);
			State = 525;
			simpleExpression(0);
			State = 530;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==COMMA) {
				{
				{
				State = 526;
				Match(COMMA);
				State = 527;
				simpleExpression(0);
				}
				}
				State = 532;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			State = 533;
			Match(RIGHT_PAREN);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectTableValuesContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode VALUES() { return GetToken(QueryCatParser.VALUES, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectTableValuesRowContext[] selectTableValuesRow() {
			return GetRuleContexts<SelectTableValuesRowContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectTableValuesRowContext selectTableValuesRow(int i) {
			return GetRuleContext<SelectTableValuesRowContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectTableValuesContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectTableValues; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTableValues(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectTableValuesContext selectTableValues() {
		SelectTableValuesContext _localctx = new SelectTableValuesContext(Context, State);
		EnterRule(_localctx, 60, RULE_selectTableValues);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 535;
			Match(VALUES);
			State = 536;
			selectTableValuesRow();
			State = 541;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==COMMA) {
				{
				{
				State = 537;
				Match(COMMA);
				State = 538;
				selectTableValuesRow();
				}
				}
				State = 543;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectTablePrimaryContext : ParserRuleContext {
		public SelectTablePrimaryContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectTablePrimary; } }
	 
		public SelectTablePrimaryContext() { }
		public virtual void CopyFrom(SelectTablePrimaryContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class SelectTablePrimaryExpressionContext : SelectTablePrimaryContext {
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectAliasContext selectAlias() {
			return GetRuleContext<SelectAliasContext>(0);
		}
		public SelectTablePrimaryExpressionContext(SelectTablePrimaryContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTablePrimaryExpression(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectTablePrimaryNoFormatContext : SelectTablePrimaryContext {
		public FunctionCallContext func;
		public FunctionCallContext format;
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext[] functionCall() {
			return GetRuleContexts<FunctionCallContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall(int i) {
			return GetRuleContext<FunctionCallContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FORMAT() { return GetToken(QueryCatParser.FORMAT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectAliasContext selectAlias() {
			return GetRuleContext<SelectAliasContext>(0);
		}
		public SelectTablePrimaryNoFormatContext(SelectTablePrimaryContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTablePrimaryNoFormat(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectTablePrimarySubqueryContext : SelectTablePrimaryContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionContext selectQueryExpression() {
			return GetRuleContext<SelectQueryExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectAliasContext selectAlias() {
			return GetRuleContext<SelectAliasContext>(0);
		}
		public SelectTablePrimarySubqueryContext(SelectTablePrimaryContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTablePrimarySubquery(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectTablePrimaryWithFormatContext : SelectTablePrimaryContext {
		public IToken uri;
		public FunctionCallContext format;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING_LITERAL() { return GetToken(QueryCatParser.STRING_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FORMAT() { return GetToken(QueryCatParser.FORMAT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectAliasContext selectAlias() {
			return GetRuleContext<SelectAliasContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall() {
			return GetRuleContext<FunctionCallContext>(0);
		}
		public SelectTablePrimaryWithFormatContext(SelectTablePrimaryContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTablePrimaryWithFormat(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectTablePrimaryTableValuesContext : SelectTablePrimaryContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectTableValuesContext selectTableValues() {
			return GetRuleContext<SelectTableValuesContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectAliasContext selectAlias() {
			return GetRuleContext<SelectAliasContext>(0);
		}
		public SelectTablePrimaryTableValuesContext(SelectTablePrimaryContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTablePrimaryTableValues(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectTablePrimaryStdinContext : SelectTablePrimaryContext {
		public FunctionCallContext format;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MINUS() { return GetToken(QueryCatParser.MINUS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FORMAT() { return GetToken(QueryCatParser.FORMAT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectAliasContext selectAlias() {
			return GetRuleContext<SelectAliasContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall() {
			return GetRuleContext<FunctionCallContext>(0);
		}
		public SelectTablePrimaryStdinContext(SelectTablePrimaryContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTablePrimaryStdin(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectTablePrimaryIdentifierContext : SelectTablePrimaryContext {
		public IdentifierContext name;
		public FunctionCallContext format;
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext identifier() {
			return GetRuleContext<IdentifierContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FORMAT() { return GetToken(QueryCatParser.FORMAT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectAliasContext selectAlias() {
			return GetRuleContext<SelectAliasContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall() {
			return GetRuleContext<FunctionCallContext>(0);
		}
		public SelectTablePrimaryIdentifierContext(SelectTablePrimaryContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTablePrimaryIdentifier(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectTablePrimaryContext selectTablePrimary() {
		SelectTablePrimaryContext _localctx = new SelectTablePrimaryContext(Context, State);
		EnterRule(_localctx, 62, RULE_selectTablePrimary);
		try {
			State = 592;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,85,Context) ) {
			case 1:
				_localctx = new SelectTablePrimaryNoFormatContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 544;
				((SelectTablePrimaryNoFormatContext)_localctx).func = functionCall();
				State = 547;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,74,Context) ) {
				case 1:
					{
					State = 545;
					Match(FORMAT);
					State = 546;
					((SelectTablePrimaryNoFormatContext)_localctx).format = functionCall();
					}
					break;
				}
				State = 550;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,75,Context) ) {
				case 1:
					{
					State = 549;
					selectAlias();
					}
					break;
				}
				}
				break;
			case 2:
				_localctx = new SelectTablePrimaryStdinContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 552;
				Match(MINUS);
				State = 555;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,76,Context) ) {
				case 1:
					{
					State = 553;
					Match(FORMAT);
					State = 554;
					((SelectTablePrimaryStdinContext)_localctx).format = functionCall();
					}
					break;
				}
				State = 558;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,77,Context) ) {
				case 1:
					{
					State = 557;
					selectAlias();
					}
					break;
				}
				}
				break;
			case 3:
				_localctx = new SelectTablePrimaryWithFormatContext(_localctx);
				EnterOuterAlt(_localctx, 3);
				{
				State = 560;
				((SelectTablePrimaryWithFormatContext)_localctx).uri = Match(STRING_LITERAL);
				State = 563;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,78,Context) ) {
				case 1:
					{
					State = 561;
					Match(FORMAT);
					State = 562;
					((SelectTablePrimaryWithFormatContext)_localctx).format = functionCall();
					}
					break;
				}
				State = 566;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,79,Context) ) {
				case 1:
					{
					State = 565;
					selectAlias();
					}
					break;
				}
				}
				break;
			case 4:
				_localctx = new SelectTablePrimarySubqueryContext(_localctx);
				EnterOuterAlt(_localctx, 4);
				{
				State = 568;
				Match(LEFT_PAREN);
				State = 569;
				selectQueryExpression();
				State = 570;
				Match(RIGHT_PAREN);
				State = 572;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,80,Context) ) {
				case 1:
					{
					State = 571;
					selectAlias();
					}
					break;
				}
				}
				break;
			case 5:
				_localctx = new SelectTablePrimaryIdentifierContext(_localctx);
				EnterOuterAlt(_localctx, 5);
				{
				State = 574;
				((SelectTablePrimaryIdentifierContext)_localctx).name = identifier();
				State = 577;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,81,Context) ) {
				case 1:
					{
					State = 575;
					Match(FORMAT);
					State = 576;
					((SelectTablePrimaryIdentifierContext)_localctx).format = functionCall();
					}
					break;
				}
				State = 580;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,82,Context) ) {
				case 1:
					{
					State = 579;
					selectAlias();
					}
					break;
				}
				}
				break;
			case 6:
				_localctx = new SelectTablePrimaryTableValuesContext(_localctx);
				EnterOuterAlt(_localctx, 6);
				{
				State = 582;
				Match(LEFT_PAREN);
				State = 583;
				selectTableValues();
				State = 584;
				Match(RIGHT_PAREN);
				State = 586;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,83,Context) ) {
				case 1:
					{
					State = 585;
					selectAlias();
					}
					break;
				}
				}
				break;
			case 7:
				_localctx = new SelectTablePrimaryExpressionContext(_localctx);
				EnterOuterAlt(_localctx, 7);
				{
				State = 588;
				simpleExpression(0);
				State = 590;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,84,Context) ) {
				case 1:
					{
					State = 589;
					selectAlias();
					}
					break;
				}
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectTableJoinedContext : ParserRuleContext {
		public SelectTableJoinedContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectTableJoined; } }
	 
		public SelectTableJoinedContext() { }
		public virtual void CopyFrom(SelectTableJoinedContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class SelectTableJoinedUsingContext : SelectTableJoinedContext {
		public SelectTablePrimaryContext right;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode JOIN() { return GetToken(QueryCatParser.JOIN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode USING() { return GetToken(QueryCatParser.USING, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext[] identifier() {
			return GetRuleContexts<IdentifierContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext identifier(int i) {
			return GetRuleContext<IdentifierContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectTablePrimaryContext selectTablePrimary() {
			return GetRuleContext<SelectTablePrimaryContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectJoinTypeContext selectJoinType() {
			return GetRuleContext<SelectJoinTypeContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectTableJoinedUsingContext(SelectTableJoinedContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTableJoinedUsing(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SelectTableJoinedOnContext : SelectTableJoinedContext {
		public SelectTablePrimaryContext right;
		public ExpressionContext condition;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode JOIN() { return GetToken(QueryCatParser.JOIN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ON() { return GetToken(QueryCatParser.ON, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectTablePrimaryContext selectTablePrimary() {
			return GetRuleContext<SelectTablePrimaryContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectJoinTypeContext selectJoinType() {
			return GetRuleContext<SelectJoinTypeContext>(0);
		}
		public SelectTableJoinedOnContext(SelectTableJoinedContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTableJoinedOn(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectTableJoinedContext selectTableJoined() {
		SelectTableJoinedContext _localctx = new SelectTableJoinedContext(Context, State);
		EnterRule(_localctx, 64, RULE_selectTableJoined);
		int _la;
		try {
			State = 619;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,89,Context) ) {
			case 1:
				_localctx = new SelectTableJoinedOnContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 595;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (((((_la - 115)) & ~0x3f) == 0 && ((1L << (_la - 115)) & 524553L) != 0)) {
					{
					State = 594;
					selectJoinType();
					}
				}

				State = 597;
				Match(JOIN);
				State = 598;
				((SelectTableJoinedOnContext)_localctx).right = selectTablePrimary();
				State = 599;
				Match(ON);
				State = 600;
				((SelectTableJoinedOnContext)_localctx).condition = expression(0);
				}
				break;
			case 2:
				_localctx = new SelectTableJoinedUsingContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 603;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (((((_la - 115)) & ~0x3f) == 0 && ((1L << (_la - 115)) & 524553L) != 0)) {
					{
					State = 602;
					selectJoinType();
					}
				}

				State = 605;
				Match(JOIN);
				State = 606;
				((SelectTableJoinedUsingContext)_localctx).right = selectTablePrimary();
				State = 607;
				Match(USING);
				State = 608;
				Match(LEFT_PAREN);
				State = 609;
				identifier();
				State = 614;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				while (_la==COMMA) {
					{
					{
					State = 610;
					Match(COMMA);
					State = 611;
					identifier();
					}
					}
					State = 616;
					ErrorHandler.Sync(this);
					_la = TokenStream.LA(1);
				}
				State = 617;
				Match(RIGHT_PAREN);
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectJoinTypeContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INNER() { return GetToken(QueryCatParser.INNER, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT() { return GetToken(QueryCatParser.LEFT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT() { return GetToken(QueryCatParser.RIGHT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FULL() { return GetToken(QueryCatParser.FULL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode OUTER() { return GetToken(QueryCatParser.OUTER, 0); }
		public SelectJoinTypeContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectJoinType; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectJoinType(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectJoinTypeContext selectJoinType() {
		SelectJoinTypeContext _localctx = new SelectJoinTypeContext(Context, State);
		EnterRule(_localctx, 66, RULE_selectJoinType);
		int _la;
		try {
			State = 626;
			ErrorHandler.Sync(this);
			switch (TokenStream.LA(1)) {
			case INNER:
				EnterOuterAlt(_localctx, 1);
				{
				State = 621;
				Match(INNER);
				}
				break;
			case FULL:
			case LEFT:
			case RIGHT:
				EnterOuterAlt(_localctx, 2);
				{
				State = 622;
				_la = TokenStream.LA(1);
				if ( !(((((_la - 115)) & ~0x3f) == 0 && ((1L << (_la - 115)) & 524545L) != 0)) ) {
				ErrorHandler.RecoverInline(this);
				}
				else {
					ErrorHandler.ReportMatch(this);
				    Consume();
				}
				State = 624;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (_la==OUTER) {
					{
					State = 623;
					Match(OUTER);
					}
				}

				}
				break;
			default:
				throw new NoViableAltException(this);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectGroupByContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode GROUP() { return GetToken(QueryCatParser.GROUP, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BY() { return GetToken(QueryCatParser.BY, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext[] expression() {
			return GetRuleContexts<ExpressionContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression(int i) {
			return GetRuleContext<ExpressionContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectGroupByContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectGroupBy; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectGroupBy(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectGroupByContext selectGroupBy() {
		SelectGroupByContext _localctx = new SelectGroupByContext(Context, State);
		EnterRule(_localctx, 68, RULE_selectGroupBy);
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			State = 628;
			Match(GROUP);
			State = 629;
			Match(BY);
			State = 630;
			expression(0);
			State = 635;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,92,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					{
					{
					State = 631;
					Match(COMMA);
					State = 632;
					expression(0);
					}
					} 
				}
				State = 637;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,92,Context);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectHavingContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode HAVING() { return GetToken(QueryCatParser.HAVING, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		public SelectHavingContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectHaving; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectHaving(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectHavingContext selectHaving() {
		SelectHavingContext _localctx = new SelectHavingContext(Context, State);
		EnterRule(_localctx, 70, RULE_selectHaving);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 638;
			Match(HAVING);
			State = 639;
			expression(0);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectSearchConditionContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WHERE() { return GetToken(QueryCatParser.WHERE, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		public SelectSearchConditionContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectSearchCondition; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectSearchCondition(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectSearchConditionContext selectSearchCondition() {
		SelectSearchConditionContext _localctx = new SelectSearchConditionContext(Context, State);
		EnterRule(_localctx, 72, RULE_selectSearchCondition);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 641;
			Match(WHERE);
			State = 642;
			expression(0);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectWindowSpecificationContext : ParserRuleContext {
		public IdentifierSimpleContext existingWindowName;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectWindowPartitionClauseContext selectWindowPartitionClause() {
			return GetRuleContext<SelectWindowPartitionClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectWindowOrderClauseContext selectWindowOrderClause() {
			return GetRuleContext<SelectWindowOrderClauseContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple() {
			return GetRuleContext<IdentifierSimpleContext>(0);
		}
		public SelectWindowSpecificationContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectWindowSpecification; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectWindowSpecification(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectWindowSpecificationContext selectWindowSpecification() {
		SelectWindowSpecificationContext _localctx = new SelectWindowSpecificationContext(Context, State);
		EnterRule(_localctx, 74, RULE_selectWindowSpecification);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 644;
			Match(LEFT_PAREN);
			State = 646;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==AT_SIGN || _la==NO_QUOTES_IDENTIFIER || _la==QUOTES_IDENTIFIER) {
				{
				State = 645;
				_localctx.existingWindowName = identifierSimple();
				}
			}

			State = 649;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==PARTITION) {
				{
				State = 648;
				selectWindowPartitionClause();
				}
			}

			State = 652;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==ORDER) {
				{
				State = 651;
				selectWindowOrderClause();
				}
			}

			State = 654;
			Match(RIGHT_PAREN);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectWindowPartitionClauseContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode PARTITION() { return GetToken(QueryCatParser.PARTITION, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BY() { return GetToken(QueryCatParser.BY, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext[] expression() {
			return GetRuleContexts<ExpressionContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression(int i) {
			return GetRuleContext<ExpressionContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectWindowPartitionClauseContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectWindowPartitionClause; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectWindowPartitionClause(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectWindowPartitionClauseContext selectWindowPartitionClause() {
		SelectWindowPartitionClauseContext _localctx = new SelectWindowPartitionClauseContext(Context, State);
		EnterRule(_localctx, 76, RULE_selectWindowPartitionClause);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 656;
			Match(PARTITION);
			State = 657;
			Match(BY);
			State = 658;
			expression(0);
			State = 663;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==COMMA) {
				{
				{
				State = 659;
				Match(COMMA);
				State = 660;
				expression(0);
				}
				}
				State = 665;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectWindowOrderClauseContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ORDER() { return GetToken(QueryCatParser.ORDER, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BY() { return GetToken(QueryCatParser.BY, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectSortSpecificationContext[] selectSortSpecification() {
			return GetRuleContexts<SelectSortSpecificationContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectSortSpecificationContext selectSortSpecification(int i) {
			return GetRuleContext<SelectSortSpecificationContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectWindowOrderClauseContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectWindowOrderClause; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectWindowOrderClause(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectWindowOrderClauseContext selectWindowOrderClause() {
		SelectWindowOrderClauseContext _localctx = new SelectWindowOrderClauseContext(Context, State);
		EnterRule(_localctx, 78, RULE_selectWindowOrderClause);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 666;
			Match(ORDER);
			State = 667;
			Match(BY);
			State = 668;
			selectSortSpecification();
			State = 673;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==COMMA) {
				{
				{
				State = 669;
				Match(COMMA);
				State = 670;
				selectSortSpecification();
				}
				}
				State = 675;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectWindowContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WINDOW() { return GetToken(QueryCatParser.WINDOW, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectWindowDefinitionListContext[] selectWindowDefinitionList() {
			return GetRuleContexts<SelectWindowDefinitionListContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectWindowDefinitionListContext selectWindowDefinitionList(int i) {
			return GetRuleContext<SelectWindowDefinitionListContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public SelectWindowContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectWindow; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectWindow(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectWindowContext selectWindow() {
		SelectWindowContext _localctx = new SelectWindowContext(Context, State);
		EnterRule(_localctx, 80, RULE_selectWindow);
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			State = 676;
			Match(WINDOW);
			State = 677;
			selectWindowDefinitionList();
			State = 682;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,98,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					{
					{
					State = 678;
					Match(COMMA);
					State = 679;
					selectWindowDefinitionList();
					}
					} 
				}
				State = 684;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,98,Context);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectWindowDefinitionListContext : ParserRuleContext {
		public IdentifierContext name;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode AS() { return GetToken(QueryCatParser.AS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectWindowSpecificationContext selectWindowSpecification() {
			return GetRuleContext<SelectWindowSpecificationContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext identifier() {
			return GetRuleContext<IdentifierContext>(0);
		}
		public SelectWindowDefinitionListContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectWindowDefinitionList; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectWindowDefinitionList(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectWindowDefinitionListContext selectWindowDefinitionList() {
		SelectWindowDefinitionListContext _localctx = new SelectWindowDefinitionListContext(Context, State);
		EnterRule(_localctx, 82, RULE_selectWindowDefinitionList);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 685;
			_localctx.name = identifier();
			State = 686;
			Match(AS);
			State = 687;
			selectWindowSpecification();
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectOffsetClauseContext : ParserRuleContext {
		public ExpressionContext offset;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode OFFSET() { return GetToken(QueryCatParser.OFFSET, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ROW() { return GetToken(QueryCatParser.ROW, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ROWS() { return GetToken(QueryCatParser.ROWS, 0); }
		public SelectOffsetClauseContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectOffsetClause; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectOffsetClause(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectOffsetClauseContext selectOffsetClause() {
		SelectOffsetClauseContext _localctx = new SelectOffsetClauseContext(Context, State);
		EnterRule(_localctx, 84, RULE_selectOffsetClause);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 689;
			Match(OFFSET);
			{
			State = 690;
			_localctx.offset = expression(0);
			}
			State = 692;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,99,Context) ) {
			case 1:
				{
				State = 691;
				_la = TokenStream.LA(1);
				if ( !(_la==ROW || _la==ROWS) ) {
				ErrorHandler.RecoverInline(this);
				}
				else {
					ErrorHandler.ReportMatch(this);
				    Consume();
				}
				}
				break;
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectFetchFirstClauseContext : ParserRuleContext {
		public ExpressionContext limit;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FETCH() { return GetToken(QueryCatParser.FETCH, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LIMIT() { return GetToken(QueryCatParser.LIMIT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FIRST() { return GetToken(QueryCatParser.FIRST, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NEXT() { return GetToken(QueryCatParser.NEXT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ROW() { return GetToken(QueryCatParser.ROW, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ROWS() { return GetToken(QueryCatParser.ROWS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ONLY() { return GetToken(QueryCatParser.ONLY, 0); }
		public SelectFetchFirstClauseContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectFetchFirstClause; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectFetchFirstClause(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectFetchFirstClauseContext selectFetchFirstClause() {
		SelectFetchFirstClauseContext _localctx = new SelectFetchFirstClauseContext(Context, State);
		EnterRule(_localctx, 86, RULE_selectFetchFirstClause);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 694;
			_la = TokenStream.LA(1);
			if ( !(_la==FETCH || _la==LIMIT) ) {
			ErrorHandler.RecoverInline(this);
			}
			else {
				ErrorHandler.ReportMatch(this);
			    Consume();
			}
			State = 696;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==FIRST || _la==NEXT) {
				{
				State = 695;
				_la = TokenStream.LA(1);
				if ( !(_la==FIRST || _la==NEXT) ) {
				ErrorHandler.RecoverInline(this);
				}
				else {
					ErrorHandler.ReportMatch(this);
				    Consume();
				}
				}
			}

			{
			State = 698;
			_localctx.limit = expression(0);
			}
			State = 700;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,101,Context) ) {
			case 1:
				{
				State = 699;
				_la = TokenStream.LA(1);
				if ( !(_la==ROW || _la==ROWS) ) {
				ErrorHandler.RecoverInline(this);
				}
				else {
					ErrorHandler.ReportMatch(this);
				    Consume();
				}
				}
				break;
			}
			State = 703;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,102,Context) ) {
			case 1:
				{
				State = 702;
				_la = TokenStream.LA(1);
				if ( !(_la==ONLY) ) {
				ErrorHandler.RecoverInline(this);
				}
				else {
					ErrorHandler.ReportMatch(this);
				    Consume();
				}
				}
				break;
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectTopClauseContext : ParserRuleContext {
		public IToken limit;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TOP() { return GetToken(QueryCatParser.TOP, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INTEGER_LITERAL() { return GetToken(QueryCatParser.INTEGER_LITERAL, 0); }
		public SelectTopClauseContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectTopClause; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectTopClause(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectTopClauseContext selectTopClause() {
		SelectTopClauseContext _localctx = new SelectTopClauseContext(Context, State);
		EnterRule(_localctx, 88, RULE_selectTopClause);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 705;
			Match(TOP);
			State = 706;
			_localctx.limit = Match(INTEGER_LITERAL);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class SelectLimitClauseContext : ParserRuleContext {
		public ExpressionContext limit;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LIMIT() { return GetToken(QueryCatParser.LIMIT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		public SelectLimitClauseContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_selectLimitClause; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSelectLimitClause(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SelectLimitClauseContext selectLimitClause() {
		SelectLimitClauseContext _localctx = new SelectLimitClauseContext(Context, State);
		EnterRule(_localctx, 90, RULE_selectLimitClause);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 708;
			Match(LIMIT);
			State = 709;
			_localctx.limit = expression(0);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class UpdateStatementContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode UPDATE() { return GetToken(QueryCatParser.UPDATE, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public UpdateSourceContext updateSource() {
			return GetRuleContext<UpdateSourceContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SET() { return GetToken(QueryCatParser.SET, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public UpdateSetClauseContext[] updateSetClause() {
			return GetRuleContexts<UpdateSetClauseContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public UpdateSetClauseContext updateSetClause(int i) {
			return GetRuleContext<UpdateSetClauseContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectSearchConditionContext selectSearchCondition() {
			return GetRuleContext<SelectSearchConditionContext>(0);
		}
		public UpdateStatementContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_updateStatement; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitUpdateStatement(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public UpdateStatementContext updateStatement() {
		UpdateStatementContext _localctx = new UpdateStatementContext(Context, State);
		EnterRule(_localctx, 92, RULE_updateStatement);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 711;
			Match(UPDATE);
			State = 712;
			updateSource();
			State = 713;
			Match(SET);
			State = 714;
			updateSetClause();
			State = 719;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==COMMA) {
				{
				{
				State = 715;
				Match(COMMA);
				State = 716;
				updateSetClause();
				}
				}
				State = 721;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			State = 723;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==WHERE) {
				{
				State = 722;
				selectSearchCondition();
				}
			}

			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class UpdateSourceContext : ParserRuleContext {
		public UpdateSourceContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_updateSource; } }
	 
		public UpdateSourceContext() { }
		public virtual void CopyFrom(UpdateSourceContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class UpdateFromVariableContext : UpdateSourceContext {
		public IdentifierContext name;
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext identifier() {
			return GetRuleContext<IdentifierContext>(0);
		}
		public UpdateFromVariableContext(UpdateSourceContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitUpdateFromVariable(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class UpdateWithFormatContext : UpdateSourceContext {
		public IToken uri;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING_LITERAL() { return GetToken(QueryCatParser.STRING_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FORMAT() { return GetToken(QueryCatParser.FORMAT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall() {
			return GetRuleContext<FunctionCallContext>(0);
		}
		public UpdateWithFormatContext(UpdateSourceContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitUpdateWithFormat(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class UpdateNoFormatContext : UpdateSourceContext {
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall() {
			return GetRuleContext<FunctionCallContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SelectAliasContext selectAlias() {
			return GetRuleContext<SelectAliasContext>(0);
		}
		public UpdateNoFormatContext(UpdateSourceContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitUpdateNoFormat(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public UpdateSourceContext updateSource() {
		UpdateSourceContext _localctx = new UpdateSourceContext(Context, State);
		EnterRule(_localctx, 94, RULE_updateSource);
		int _la;
		try {
			State = 735;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,107,Context) ) {
			case 1:
				_localctx = new UpdateNoFormatContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 725;
				functionCall();
				State = 727;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (_la==AT_SIGN || _la==AS || ((((_la - 160)) & ~0x3f) == 0 && ((1L << (_la - 160)) & 35L) != 0)) {
					{
					State = 726;
					selectAlias();
					}
				}

				}
				break;
			case 2:
				_localctx = new UpdateWithFormatContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 729;
				((UpdateWithFormatContext)_localctx).uri = Match(STRING_LITERAL);
				State = 732;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (_la==FORMAT) {
					{
					State = 730;
					Match(FORMAT);
					State = 731;
					functionCall();
					}
				}

				}
				break;
			case 3:
				_localctx = new UpdateFromVariableContext(_localctx);
				EnterOuterAlt(_localctx, 3);
				{
				State = 734;
				((UpdateFromVariableContext)_localctx).name = identifier();
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class UpdateSetClauseContext : ParserRuleContext {
		public IdentifierContext source;
		public ExpressionContext target;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode EQUALS() { return GetToken(QueryCatParser.EQUALS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext identifier() {
			return GetRuleContext<IdentifierContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		public UpdateSetClauseContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_updateSetClause; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitUpdateSetClause(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public UpdateSetClauseContext updateSetClause() {
		UpdateSetClauseContext _localctx = new UpdateSetClauseContext(Context, State);
		EnterRule(_localctx, 96, RULE_updateSetClause);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 737;
			_localctx.source = identifier();
			State = 738;
			Match(EQUALS);
			State = 739;
			_localctx.target = expression(0);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class InsertStatementContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INSERT() { return GetToken(QueryCatParser.INSERT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INTO() { return GetToken(QueryCatParser.INTO, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public InsertToSourceContext insertToSource() {
			return GetRuleContext<InsertToSourceContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public InsertFromSourceContext insertFromSource() {
			return GetRuleContext<InsertFromSourceContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public InsertColumnsListContext insertColumnsList() {
			return GetRuleContext<InsertColumnsListContext>(0);
		}
		public InsertStatementContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_insertStatement; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitInsertStatement(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public InsertStatementContext insertStatement() {
		InsertStatementContext _localctx = new InsertStatementContext(Context, State);
		EnterRule(_localctx, 98, RULE_insertStatement);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 741;
			Match(INSERT);
			State = 742;
			Match(INTO);
			State = 743;
			insertToSource();
			State = 745;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,108,Context) ) {
			case 1:
				{
				State = 744;
				insertColumnsList();
				}
				break;
			}
			State = 747;
			insertFromSource();
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class InsertToSourceContext : ParserRuleContext {
		public InsertToSourceContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_insertToSource; } }
	 
		public InsertToSourceContext() { }
		public virtual void CopyFrom(InsertToSourceContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class InsertFromVariableContext : InsertToSourceContext {
		public IdentifierContext name;
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext identifier() {
			return GetRuleContext<IdentifierContext>(0);
		}
		public InsertFromVariableContext(InsertToSourceContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitInsertFromVariable(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class InsertWithFormatContext : InsertToSourceContext {
		public IToken uri;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING_LITERAL() { return GetToken(QueryCatParser.STRING_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FORMAT() { return GetToken(QueryCatParser.FORMAT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall() {
			return GetRuleContext<FunctionCallContext>(0);
		}
		public InsertWithFormatContext(InsertToSourceContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitInsertWithFormat(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class InsertNoFormatContext : InsertToSourceContext {
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall() {
			return GetRuleContext<FunctionCallContext>(0);
		}
		public InsertNoFormatContext(InsertToSourceContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitInsertNoFormat(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public InsertToSourceContext insertToSource() {
		InsertToSourceContext _localctx = new InsertToSourceContext(Context, State);
		EnterRule(_localctx, 100, RULE_insertToSource);
		int _la;
		try {
			State = 756;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,110,Context) ) {
			case 1:
				_localctx = new InsertNoFormatContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 749;
				functionCall();
				}
				break;
			case 2:
				_localctx = new InsertWithFormatContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 750;
				((InsertWithFormatContext)_localctx).uri = Match(STRING_LITERAL);
				State = 753;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (_la==FORMAT) {
					{
					State = 751;
					Match(FORMAT);
					State = 752;
					functionCall();
					}
				}

				}
				break;
			case 3:
				_localctx = new InsertFromVariableContext(_localctx);
				EnterOuterAlt(_localctx, 3);
				{
				State = 755;
				((InsertFromVariableContext)_localctx).name = identifier();
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class InsertColumnsListContext : ParserRuleContext {
		public IdentifierContext name;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext[] identifier() {
			return GetRuleContexts<IdentifierContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext identifier(int i) {
			return GetRuleContext<IdentifierContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public InsertColumnsListContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_insertColumnsList; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitInsertColumnsList(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public InsertColumnsListContext insertColumnsList() {
		InsertColumnsListContext _localctx = new InsertColumnsListContext(Context, State);
		EnterRule(_localctx, 102, RULE_insertColumnsList);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 758;
			Match(LEFT_PAREN);
			State = 759;
			_localctx.name = identifier();
			State = 764;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==COMMA) {
				{
				{
				State = 760;
				Match(COMMA);
				State = 761;
				_localctx.name = identifier();
				}
				}
				State = 766;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			State = 767;
			Match(RIGHT_PAREN);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class InsertFromSourceContext : ParserRuleContext {
		public InsertFromSourceContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_insertFromSource; } }
	 
		public InsertFromSourceContext() { }
		public virtual void CopyFrom(InsertFromSourceContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class InsertSourceQueryContext : InsertFromSourceContext {
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionContext selectQueryExpression() {
			return GetRuleContext<SelectQueryExpressionContext>(0);
		}
		public InsertSourceQueryContext(InsertFromSourceContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitInsertSourceQuery(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class InsertSourceTableContext : InsertFromSourceContext {
		[System.Diagnostics.DebuggerNonUserCode] public SelectTableValuesContext selectTableValues() {
			return GetRuleContext<SelectTableValuesContext>(0);
		}
		public InsertSourceTableContext(InsertFromSourceContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitInsertSourceTable(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public InsertFromSourceContext insertFromSource() {
		InsertFromSourceContext _localctx = new InsertFromSourceContext(Context, State);
		EnterRule(_localctx, 104, RULE_insertFromSource);
		try {
			State = 771;
			ErrorHandler.Sync(this);
			switch (TokenStream.LA(1)) {
			case LEFT_PAREN:
			case SELECT:
			case WITH:
				_localctx = new InsertSourceQueryContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 769;
				selectQueryExpression();
				}
				break;
			case VALUES:
				_localctx = new InsertSourceTableContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 770;
				selectTableValues();
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class EchoStatementContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ECHO() { return GetToken(QueryCatParser.ECHO, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		public EchoStatementContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_echoStatement; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitEchoStatement(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public EchoStatementContext echoStatement() {
		EchoStatementContext _localctx = new EchoStatementContext(Context, State);
		EnterRule(_localctx, 106, RULE_echoStatement);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 773;
			Match(ECHO);
			State = 774;
			expression(0);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class CallStatementContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode CALL() { return GetToken(QueryCatParser.CALL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall() {
			return GetRuleContext<FunctionCallContext>(0);
		}
		public CallStatementContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_callStatement; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitCallStatement(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public CallStatementContext callStatement() {
		CallStatementContext _localctx = new CallStatementContext(Context, State);
		EnterRule(_localctx, 108, RULE_callStatement);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 776;
			Match(CALL);
			State = 777;
			functionCall();
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class IfStatementContext : ParserRuleContext {
		public IfConditionContext mainIf;
		public IfConditionContext elseIf;
		public BlockExpressionContext elseBlock;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode IF() { return GetToken(QueryCatParser.IF, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public IfConditionContext[] ifCondition() {
			return GetRuleContexts<IfConditionContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public IfConditionContext ifCondition(int i) {
			return GetRuleContext<IfConditionContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] ELSEIF() { return GetTokens(QueryCatParser.ELSEIF); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ELSEIF(int i) {
			return GetToken(QueryCatParser.ELSEIF, i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ELSE() { return GetToken(QueryCatParser.ELSE, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public BlockExpressionContext blockExpression() {
			return GetRuleContext<BlockExpressionContext>(0);
		}
		public IfStatementContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_ifStatement; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitIfStatement(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public IfStatementContext ifStatement() {
		IfStatementContext _localctx = new IfStatementContext(Context, State);
		EnterRule(_localctx, 110, RULE_ifStatement);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 779;
			Match(IF);
			State = 780;
			_localctx.mainIf = ifCondition();
			State = 785;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==ELSEIF) {
				{
				{
				State = 781;
				Match(ELSEIF);
				State = 782;
				_localctx.elseIf = ifCondition();
				}
				}
				State = 787;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			State = 790;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==ELSE) {
				{
				State = 788;
				Match(ELSE);
				State = 789;
				_localctx.elseBlock = blockExpression();
				}
			}

			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class IfConditionContext : ParserRuleContext {
		public ExpressionContext condition;
		public BlockExpressionContext block;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode THEN() { return GetToken(QueryCatParser.THEN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public BlockExpressionContext blockExpression() {
			return GetRuleContext<BlockExpressionContext>(0);
		}
		public IfConditionContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_ifCondition; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitIfCondition(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public IfConditionContext ifCondition() {
		IfConditionContext _localctx = new IfConditionContext(Context, State);
		EnterRule(_localctx, 112, RULE_ifCondition);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 792;
			_localctx.condition = expression(0);
			State = 793;
			Match(THEN);
			State = 794;
			_localctx.block = blockExpression();
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class IdentifierSimpleContext : ParserRuleContext {
		public IdentifierSimpleContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_identifierSimple; } }
	 
		public IdentifierSimpleContext() { }
		public virtual void CopyFrom(IdentifierSimpleContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class IdentifierSimpleNoQuotesContext : IdentifierSimpleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NO_QUOTES_IDENTIFIER() { return GetToken(QueryCatParser.NO_QUOTES_IDENTIFIER, 0); }
		public IdentifierSimpleNoQuotesContext(IdentifierSimpleContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitIdentifierSimpleNoQuotes(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class IdentifierSimpleCurrentContext : IdentifierSimpleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode AT_SIGN() { return GetToken(QueryCatParser.AT_SIGN, 0); }
		public IdentifierSimpleCurrentContext(IdentifierSimpleContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitIdentifierSimpleCurrent(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class IdentifierSimpleQuotesContext : IdentifierSimpleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode QUOTES_IDENTIFIER() { return GetToken(QueryCatParser.QUOTES_IDENTIFIER, 0); }
		public IdentifierSimpleQuotesContext(IdentifierSimpleContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitIdentifierSimpleQuotes(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public IdentifierSimpleContext identifierSimple() {
		IdentifierSimpleContext _localctx = new IdentifierSimpleContext(Context, State);
		EnterRule(_localctx, 114, RULE_identifierSimple);
		try {
			State = 799;
			ErrorHandler.Sync(this);
			switch (TokenStream.LA(1)) {
			case NO_QUOTES_IDENTIFIER:
				_localctx = new IdentifierSimpleNoQuotesContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 796;
				Match(NO_QUOTES_IDENTIFIER);
				}
				break;
			case QUOTES_IDENTIFIER:
				_localctx = new IdentifierSimpleQuotesContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 797;
				Match(QUOTES_IDENTIFIER);
				}
				break;
			case AT_SIGN:
				_localctx = new IdentifierSimpleCurrentContext(_localctx);
				EnterOuterAlt(_localctx, 3);
				{
				State = 798;
				Match(AT_SIGN);
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class IdentifierContext : ParserRuleContext {
		public IdentifierContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_identifier; } }
	 
		public IdentifierContext() { }
		public virtual void CopyFrom(IdentifierContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class IdentifierWithSelectorContext : IdentifierContext {
		public IdentifierSimpleContext name;
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple() {
			return GetRuleContext<IdentifierSimpleContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSelectorContext[] identifierSelector() {
			return GetRuleContexts<IdentifierSelectorContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSelectorContext identifierSelector(int i) {
			return GetRuleContext<IdentifierSelectorContext>(i);
		}
		public IdentifierWithSelectorContext(IdentifierContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitIdentifierWithSelector(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class IdentifierWithoutSourceContext : IdentifierContext {
		public IdentifierSimpleContext name;
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple() {
			return GetRuleContext<IdentifierSimpleContext>(0);
		}
		public IdentifierWithoutSourceContext(IdentifierContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitIdentifierWithoutSource(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public IdentifierContext identifier() {
		IdentifierContext _localctx = new IdentifierContext(Context, State);
		EnterRule(_localctx, 116, RULE_identifier);
		try {
			int _alt;
			State = 809;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,117,Context) ) {
			case 1:
				_localctx = new IdentifierWithSelectorContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 801;
				((IdentifierWithSelectorContext)_localctx).name = identifierSimple();
				State = 805;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,116,Context);
				while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
					if ( _alt==1 ) {
						{
						{
						State = 802;
						identifierSelector();
						}
						} 
					}
					State = 807;
					ErrorHandler.Sync(this);
					_alt = Interpreter.AdaptivePredict(TokenStream,116,Context);
				}
				}
				break;
			case 2:
				_localctx = new IdentifierWithoutSourceContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 808;
				((IdentifierWithoutSourceContext)_localctx).name = identifierSimple();
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class IdentifierSelectorContext : ParserRuleContext {
		public IdentifierSelectorContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_identifierSelector; } }
	 
		public IdentifierSelectorContext() { }
		public virtual void CopyFrom(IdentifierSelectorContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class IdentifierSelectorIndexContext : IdentifierSelectorContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_BRACKET() { return GetToken(QueryCatParser.LEFT_BRACKET, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext[] simpleExpression() {
			return GetRuleContexts<SimpleExpressionContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression(int i) {
			return GetRuleContext<SimpleExpressionContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_BRACKET() { return GetToken(QueryCatParser.RIGHT_BRACKET, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public IdentifierSelectorIndexContext(IdentifierSelectorContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitIdentifierSelectorIndex(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class IdentifierSelectorFilterExpressionContext : IdentifierSelectorContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_BRACKET() { return GetToken(QueryCatParser.LEFT_BRACKET, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode QUESTION() { return GetToken(QueryCatParser.QUESTION, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_BRACKET() { return GetToken(QueryCatParser.RIGHT_BRACKET, 0); }
		public IdentifierSelectorFilterExpressionContext(IdentifierSelectorContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitIdentifierSelectorFilterExpression(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class IdentifierSelectorPropertyContext : IdentifierSelectorContext {
		public IdentifierSimpleContext name;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode PERIOD() { return GetToken(QueryCatParser.PERIOD, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierSimpleContext identifierSimple() {
			return GetRuleContext<IdentifierSimpleContext>(0);
		}
		public IdentifierSelectorPropertyContext(IdentifierSelectorContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitIdentifierSelectorProperty(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public IdentifierSelectorContext identifierSelector() {
		IdentifierSelectorContext _localctx = new IdentifierSelectorContext(Context, State);
		EnterRule(_localctx, 118, RULE_identifierSelector);
		int _la;
		try {
			State = 829;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,119,Context) ) {
			case 1:
				_localctx = new IdentifierSelectorPropertyContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 811;
				Match(PERIOD);
				State = 812;
				((IdentifierSelectorPropertyContext)_localctx).name = identifierSimple();
				}
				break;
			case 2:
				_localctx = new IdentifierSelectorIndexContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 813;
				Match(LEFT_BRACKET);
				State = 814;
				simpleExpression(0);
				State = 819;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				while (_la==COMMA) {
					{
					{
					State = 815;
					Match(COMMA);
					State = 816;
					simpleExpression(0);
					}
					}
					State = 821;
					ErrorHandler.Sync(this);
					_la = TokenStream.LA(1);
				}
				State = 822;
				Match(RIGHT_BRACKET);
				}
				break;
			case 3:
				_localctx = new IdentifierSelectorFilterExpressionContext(_localctx);
				EnterOuterAlt(_localctx, 3);
				{
				State = 824;
				Match(LEFT_BRACKET);
				State = 825;
				Match(QUESTION);
				State = 826;
				simpleExpression(0);
				State = 827;
				Match(RIGHT_BRACKET);
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class ArrayContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext[] expression() {
			return GetRuleContexts<ExpressionContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression(int i) {
			return GetRuleContext<ExpressionContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public ArrayContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_array; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitArray(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public ArrayContext array() {
		ArrayContext _localctx = new ArrayContext(Context, State);
		EnterRule(_localctx, 120, RULE_array);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 831;
			Match(LEFT_PAREN);
			State = 832;
			expression(0);
			State = 837;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==COMMA) {
				{
				{
				State = 833;
				Match(COMMA);
				State = 834;
				expression(0);
				}
				}
				State = 839;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			State = 840;
			Match(RIGHT_PAREN);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class IntervalLiteralContext : ParserRuleContext {
		public IToken interval;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INTERVAL() { return GetToken(QueryCatParser.INTERVAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING_LITERAL() { return GetToken(QueryCatParser.STRING_LITERAL, 0); }
		public IntervalLiteralContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_intervalLiteral; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitIntervalLiteral(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public IntervalLiteralContext intervalLiteral() {
		IntervalLiteralContext _localctx = new IntervalLiteralContext(Context, State);
		EnterRule(_localctx, 122, RULE_intervalLiteral);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 842;
			Match(INTERVAL);
			State = 843;
			_localctx.interval = Match(STRING_LITERAL);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class BlockExpressionContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BEGIN() { return GetToken(QueryCatParser.BEGIN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public StatementContext[] statement() {
			return GetRuleContexts<StatementContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public StatementContext statement(int i) {
			return GetRuleContext<StatementContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode END() { return GetToken(QueryCatParser.END, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] SEMICOLON() { return GetTokens(QueryCatParser.SEMICOLON); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SEMICOLON(int i) {
			return GetToken(QueryCatParser.SEMICOLON, i);
		}
		public BlockExpressionContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_blockExpression; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitBlockExpression(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public BlockExpressionContext blockExpression() {
		BlockExpressionContext _localctx = new BlockExpressionContext(Context, State);
		EnterRule(_localctx, 124, RULE_blockExpression);
		int _la;
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			State = 845;
			Match(BEGIN);
			State = 849;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==SEMICOLON) {
				{
				{
				State = 846;
				Match(SEMICOLON);
				}
				}
				State = 851;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			State = 852;
			statement();
			State = 857;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,122,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					{
					{
					State = 853;
					Match(SEMICOLON);
					State = 854;
					statement();
					}
					} 
				}
				State = 859;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,122,Context);
			}
			State = 863;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==SEMICOLON) {
				{
				{
				State = 860;
				Match(SEMICOLON);
				}
				}
				State = 865;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			State = 866;
			Match(END);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class CastOperandContext : ParserRuleContext {
		public SimpleExpressionContext value;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode CAST() { return GetToken(QueryCatParser.CAST, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode AS() { return GetToken(QueryCatParser.AS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public TypeContext type() {
			return GetRuleContext<TypeContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		public CastOperandContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_castOperand; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitCastOperand(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public CastOperandContext castOperand() {
		CastOperandContext _localctx = new CastOperandContext(Context, State);
		EnterRule(_localctx, 126, RULE_castOperand);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 868;
			Match(CAST);
			State = 869;
			Match(LEFT_PAREN);
			State = 870;
			_localctx.value = simpleExpression(0);
			State = 871;
			Match(AS);
			State = 872;
			type();
			State = 873;
			Match(RIGHT_PAREN);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class AtTimeZoneContext : ParserRuleContext {
		public SimpleExpressionContext tz;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode AT() { return GetToken(QueryCatParser.AT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LOCAL() { return GetToken(QueryCatParser.LOCAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TIME() { return GetToken(QueryCatParser.TIME, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ZONE() { return GetToken(QueryCatParser.ZONE, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		public AtTimeZoneContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_atTimeZone; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitAtTimeZone(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public AtTimeZoneContext atTimeZone() {
		AtTimeZoneContext _localctx = new AtTimeZoneContext(Context, State);
		EnterRule(_localctx, 128, RULE_atTimeZone);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 875;
			Match(AT);
			State = 880;
			ErrorHandler.Sync(this);
			switch (TokenStream.LA(1)) {
			case LOCAL:
				{
				State = 876;
				Match(LOCAL);
				}
				break;
			case TIME:
				{
				State = 877;
				Match(TIME);
				State = 878;
				Match(ZONE);
				State = 879;
				_localctx.tz = simpleExpression(0);
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class CaseExpressionContext : ParserRuleContext {
		public SimpleExpressionContext arg;
		public ExpressionContext @default;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode CASE() { return GetToken(QueryCatParser.CASE, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode END() { return GetToken(QueryCatParser.END, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public CaseWhenContext[] caseWhen() {
			return GetRuleContexts<CaseWhenContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public CaseWhenContext caseWhen(int i) {
			return GetRuleContext<CaseWhenContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ELSE() { return GetToken(QueryCatParser.ELSE, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		public CaseExpressionContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_caseExpression; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitCaseExpression(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public CaseExpressionContext caseExpression() {
		CaseExpressionContext _localctx = new CaseExpressionContext(Context, State);
		EnterRule(_localctx, 130, RULE_caseExpression);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 882;
			Match(CASE);
			State = 884;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 154248287238258690L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & 531502260801L) != 0) || ((((_la - 160)) & ~0x3f) == 0 && ((1L << (_la - 160)) & 127L) != 0)) {
				{
				State = 883;
				_localctx.arg = simpleExpression(0);
				}
			}

			State = 889;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			while (_la==WHEN) {
				{
				{
				State = 886;
				caseWhen();
				}
				}
				State = 891;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
			}
			State = 894;
			ErrorHandler.Sync(this);
			_la = TokenStream.LA(1);
			if (_la==ELSE) {
				{
				State = 892;
				Match(ELSE);
				State = 893;
				_localctx.@default = expression(0);
				}
			}

			State = 896;
			Match(END);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class CaseWhenContext : ParserRuleContext {
		public ExpressionContext condition;
		public ExpressionContext result;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WHEN() { return GetToken(QueryCatParser.WHEN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode THEN() { return GetToken(QueryCatParser.THEN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext[] expression() {
			return GetRuleContexts<ExpressionContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression(int i) {
			return GetRuleContext<ExpressionContext>(i);
		}
		public CaseWhenContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_caseWhen; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitCaseWhen(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public CaseWhenContext caseWhen() {
		CaseWhenContext _localctx = new CaseWhenContext(Context, State);
		EnterRule(_localctx, 132, RULE_caseWhen);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 898;
			Match(WHEN);
			State = 899;
			_localctx.condition = expression(0);
			State = 900;
			Match(THEN);
			State = 901;
			_localctx.result = expression(0);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class StandardFunctionContext : ParserRuleContext {
		public StandardFunctionContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_standardFunction; } }
	 
		public StandardFunctionContext() { }
		public virtual void CopyFrom(StandardFunctionContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class StandardFunctionCurrentDateContext : StandardFunctionContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode CURRENT_DATE() { return GetToken(QueryCatParser.CURRENT_DATE, 0); }
		public StandardFunctionCurrentDateContext(StandardFunctionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStandardFunctionCurrentDate(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StandardFunctionExtractContext : StandardFunctionContext {
		public DateTimeFieldContext extractField;
		public SimpleExpressionContext source;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode EXTRACT() { return GetToken(QueryCatParser.EXTRACT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FROM() { return GetToken(QueryCatParser.FROM, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public DateTimeFieldContext dateTimeField() {
			return GetRuleContext<DateTimeFieldContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		public StandardFunctionExtractContext(StandardFunctionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStandardFunctionExtract(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StandardSubstringRegexContext : StandardFunctionContext {
		public IToken pattern;
		public SimpleExpressionContext @string;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SUBSTRING_REGEX() { return GetToken(QueryCatParser.SUBSTRING_REGEX, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode IN() { return GetToken(QueryCatParser.IN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING_LITERAL() { return GetToken(QueryCatParser.STRING_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		public StandardSubstringRegexContext(StandardFunctionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStandardSubstringRegex(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StandardFunctionCurrentTimestampContext : StandardFunctionContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode CURRENT_TIMESTAMP() { return GetToken(QueryCatParser.CURRENT_TIMESTAMP, 0); }
		public StandardFunctionCurrentTimestampContext(StandardFunctionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStandardFunctionCurrentTimestamp(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StandardFunctionTrimContext : StandardFunctionContext {
		public IToken spec;
		public IToken characters;
		public SimpleExpressionContext target;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TRIM() { return GetToken(QueryCatParser.TRIM, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FROM() { return GetToken(QueryCatParser.FROM, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING_LITERAL() { return GetToken(QueryCatParser.STRING_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEADING() { return GetToken(QueryCatParser.LEADING, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TRAILING() { return GetToken(QueryCatParser.TRAILING, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BOTH() { return GetToken(QueryCatParser.BOTH, 0); }
		public StandardFunctionTrimContext(StandardFunctionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStandardFunctionTrim(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StandardTranslateRegexContext : StandardFunctionContext {
		public IToken pattern;
		public SimpleExpressionContext @string;
		public IToken replacement;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TRANSLATE_REGEX() { return GetToken(QueryCatParser.TRANSLATE_REGEX, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode IN() { return GetToken(QueryCatParser.IN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WITH() { return GetToken(QueryCatParser.WITH, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] STRING_LITERAL() { return GetTokens(QueryCatParser.STRING_LITERAL); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING_LITERAL(int i) {
			return GetToken(QueryCatParser.STRING_LITERAL, i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		public StandardTranslateRegexContext(StandardFunctionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStandardTranslateRegex(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StandardFunctionPositionContext : StandardFunctionContext {
		public IToken substring;
		public SimpleExpressionContext @string;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode POSITION() { return GetToken(QueryCatParser.POSITION, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode IN() { return GetToken(QueryCatParser.IN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING_LITERAL() { return GetToken(QueryCatParser.STRING_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		public StandardFunctionPositionContext(StandardFunctionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStandardFunctionPosition(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StandardFunctionCoalesceContext : StandardFunctionContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COALESCE() { return GetToken(QueryCatParser.COALESCE, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext[] expression() {
			return GetRuleContexts<ExpressionContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression(int i) {
			return GetRuleContext<ExpressionContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(QueryCatParser.COMMA); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
			return GetToken(QueryCatParser.COMMA, i);
		}
		public StandardFunctionCoalesceContext(StandardFunctionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStandardFunctionCoalesce(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StandardPositionRegexContext : StandardFunctionContext {
		public IToken pattern;
		public SimpleExpressionContext @string;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode POSITION_REGEX() { return GetToken(QueryCatParser.POSITION_REGEX, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode IN() { return GetToken(QueryCatParser.IN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING_LITERAL() { return GetToken(QueryCatParser.STRING_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		public StandardPositionRegexContext(StandardFunctionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStandardPositionRegex(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class StandardOccurrencesRegexContext : StandardFunctionContext {
		public IToken pattern;
		public SimpleExpressionContext @string;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode OCCURRENCES_REGEX() { return GetToken(QueryCatParser.OCCURRENCES_REGEX, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode IN() { return GetToken(QueryCatParser.IN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING_LITERAL() { return GetToken(QueryCatParser.STRING_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		public StandardOccurrencesRegexContext(StandardFunctionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitStandardOccurrencesRegex(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public StandardFunctionContext standardFunction() {
		StandardFunctionContext _localctx = new StandardFunctionContext(Context, State);
		EnterRule(_localctx, 134, RULE_standardFunction);
		int _la;
		try {
			State = 975;
			ErrorHandler.Sync(this);
			switch (TokenStream.LA(1)) {
			case CURRENT_DATE:
				_localctx = new StandardFunctionCurrentDateContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 903;
				Match(CURRENT_DATE);
				}
				break;
			case CURRENT_TIMESTAMP:
				_localctx = new StandardFunctionCurrentTimestampContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 904;
				Match(CURRENT_TIMESTAMP);
				}
				break;
			case TRIM:
				_localctx = new StandardFunctionTrimContext(_localctx);
				EnterOuterAlt(_localctx, 3);
				{
				State = 905;
				Match(TRIM);
				State = 906;
				Match(LEFT_PAREN);
				State = 908;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (((((_la - 74)) & ~0x3f) == 0 && ((1L << (_la - 74)) & 7L) != 0)) {
					{
					State = 907;
					((StandardFunctionTrimContext)_localctx).spec = TokenStream.LT(1);
					_la = TokenStream.LA(1);
					if ( !(((((_la - 74)) & ~0x3f) == 0 && ((1L << (_la - 74)) & 7L) != 0)) ) {
						((StandardFunctionTrimContext)_localctx).spec = ErrorHandler.RecoverInline(this);
					}
					else {
						ErrorHandler.ReportMatch(this);
					    Consume();
					}
					}
				}

				State = 911;
				ErrorHandler.Sync(this);
				switch ( Interpreter.AdaptivePredict(TokenStream,129,Context) ) {
				case 1:
					{
					State = 910;
					((StandardFunctionTrimContext)_localctx).characters = Match(STRING_LITERAL);
					}
					break;
				}
				State = 914;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				if (_la==FROM) {
					{
					State = 913;
					Match(FROM);
					}
				}

				State = 916;
				((StandardFunctionTrimContext)_localctx).target = simpleExpression(0);
				State = 917;
				Match(RIGHT_PAREN);
				}
				break;
			case POSITION:
				_localctx = new StandardFunctionPositionContext(_localctx);
				EnterOuterAlt(_localctx, 4);
				{
				State = 919;
				Match(POSITION);
				State = 920;
				Match(LEFT_PAREN);
				State = 921;
				((StandardFunctionPositionContext)_localctx).substring = Match(STRING_LITERAL);
				State = 922;
				Match(IN);
				State = 923;
				((StandardFunctionPositionContext)_localctx).@string = simpleExpression(0);
				State = 924;
				Match(RIGHT_PAREN);
				}
				break;
			case EXTRACT:
				_localctx = new StandardFunctionExtractContext(_localctx);
				EnterOuterAlt(_localctx, 5);
				{
				State = 926;
				Match(EXTRACT);
				State = 927;
				Match(LEFT_PAREN);
				State = 928;
				((StandardFunctionExtractContext)_localctx).extractField = dateTimeField();
				State = 929;
				Match(FROM);
				State = 930;
				((StandardFunctionExtractContext)_localctx).source = simpleExpression(0);
				State = 931;
				Match(RIGHT_PAREN);
				}
				break;
			case COALESCE:
				_localctx = new StandardFunctionCoalesceContext(_localctx);
				EnterOuterAlt(_localctx, 6);
				{
				State = 933;
				Match(COALESCE);
				State = 934;
				Match(LEFT_PAREN);
				State = 935;
				expression(0);
				State = 940;
				ErrorHandler.Sync(this);
				_la = TokenStream.LA(1);
				while (_la==COMMA) {
					{
					{
					State = 936;
					Match(COMMA);
					State = 937;
					expression(0);
					}
					}
					State = 942;
					ErrorHandler.Sync(this);
					_la = TokenStream.LA(1);
				}
				State = 943;
				Match(RIGHT_PAREN);
				}
				break;
			case OCCURRENCES_REGEX:
				_localctx = new StandardOccurrencesRegexContext(_localctx);
				EnterOuterAlt(_localctx, 7);
				{
				State = 945;
				Match(OCCURRENCES_REGEX);
				State = 946;
				Match(LEFT_PAREN);
				State = 947;
				((StandardOccurrencesRegexContext)_localctx).pattern = Match(STRING_LITERAL);
				State = 948;
				Match(IN);
				State = 949;
				((StandardOccurrencesRegexContext)_localctx).@string = simpleExpression(0);
				State = 950;
				Match(RIGHT_PAREN);
				}
				break;
			case SUBSTRING_REGEX:
				_localctx = new StandardSubstringRegexContext(_localctx);
				EnterOuterAlt(_localctx, 8);
				{
				State = 952;
				Match(SUBSTRING_REGEX);
				State = 953;
				Match(LEFT_PAREN);
				State = 954;
				((StandardSubstringRegexContext)_localctx).pattern = Match(STRING_LITERAL);
				State = 955;
				Match(IN);
				State = 956;
				((StandardSubstringRegexContext)_localctx).@string = simpleExpression(0);
				State = 957;
				Match(RIGHT_PAREN);
				}
				break;
			case POSITION_REGEX:
				_localctx = new StandardPositionRegexContext(_localctx);
				EnterOuterAlt(_localctx, 9);
				{
				State = 959;
				Match(POSITION_REGEX);
				State = 960;
				Match(LEFT_PAREN);
				State = 961;
				((StandardPositionRegexContext)_localctx).pattern = Match(STRING_LITERAL);
				State = 962;
				Match(IN);
				State = 963;
				((StandardPositionRegexContext)_localctx).@string = simpleExpression(0);
				State = 964;
				Match(RIGHT_PAREN);
				}
				break;
			case TRANSLATE_REGEX:
				_localctx = new StandardTranslateRegexContext(_localctx);
				EnterOuterAlt(_localctx, 10);
				{
				State = 966;
				Match(TRANSLATE_REGEX);
				State = 967;
				Match(LEFT_PAREN);
				State = 968;
				((StandardTranslateRegexContext)_localctx).pattern = Match(STRING_LITERAL);
				State = 969;
				Match(IN);
				State = 970;
				((StandardTranslateRegexContext)_localctx).@string = simpleExpression(0);
				State = 971;
				Match(WITH);
				State = 972;
				((StandardTranslateRegexContext)_localctx).replacement = Match(STRING_LITERAL);
				State = 973;
				Match(RIGHT_PAREN);
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class DateTimeFieldContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode YEAR() { return GetToken(QueryCatParser.YEAR, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DOY() { return GetToken(QueryCatParser.DOY, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DAYOFYEAR() { return GetToken(QueryCatParser.DAYOFYEAR, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MONTH() { return GetToken(QueryCatParser.MONTH, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DOW() { return GetToken(QueryCatParser.DOW, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WEEKDAY() { return GetToken(QueryCatParser.WEEKDAY, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DAY() { return GetToken(QueryCatParser.DAY, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode HOUR() { return GetToken(QueryCatParser.HOUR, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MINUTE() { return GetToken(QueryCatParser.MINUTE, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SECOND() { return GetToken(QueryCatParser.SECOND, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MILLISECOND() { return GetToken(QueryCatParser.MILLISECOND, 0); }
		public DateTimeFieldContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_dateTimeField; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitDateTimeField(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public DateTimeFieldContext dateTimeField() {
		DateTimeFieldContext _localctx = new DateTimeFieldContext(Context, State);
		EnterRule(_localctx, 136, RULE_dateTimeField);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 977;
			_la = TokenStream.LA(1);
			if ( !(((((_la - 80)) & ~0x3f) == 0 && ((1L << (_la - 80)) & 2047L) != 0)) ) {
			ErrorHandler.RecoverInline(this);
			}
			else {
				ErrorHandler.ReportMatch(this);
			    Consume();
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class TypeContext : ParserRuleContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INTEGER() { return GetToken(QueryCatParser.INTEGER, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INT() { return GetToken(QueryCatParser.INT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INT8() { return GetToken(QueryCatParser.INT8, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING() { return GetToken(QueryCatParser.STRING, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TEXT() { return GetToken(QueryCatParser.TEXT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FLOAT() { return GetToken(QueryCatParser.FLOAT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode REAL() { return GetToken(QueryCatParser.REAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TIMESTAMP() { return GetToken(QueryCatParser.TIMESTAMP, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INTERVAL() { return GetToken(QueryCatParser.INTERVAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BLOB() { return GetToken(QueryCatParser.BLOB, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BOOLEAN() { return GetToken(QueryCatParser.BOOLEAN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BOOL() { return GetToken(QueryCatParser.BOOL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NUMERIC() { return GetToken(QueryCatParser.NUMERIC, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DECIMAL() { return GetToken(QueryCatParser.DECIMAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode OBJECT() { return GetToken(QueryCatParser.OBJECT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ANY() { return GetToken(QueryCatParser.ANY, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode VOID() { return GetToken(QueryCatParser.VOID, 0); }
		public TypeContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_type; } }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitType(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public TypeContext type() {
		TypeContext _localctx = new TypeContext(Context, State);
		EnterRule(_localctx, 138, RULE_type);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 979;
			_la = TokenStream.LA(1);
			if ( !(((((_la - 33)) & ~0x3f) == 0 && ((1L << (_la - 33)) & 70918500024319L) != 0)) ) {
			ErrorHandler.RecoverInline(this);
			}
			else {
				ErrorHandler.ReportMatch(this);
			    Consume();
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public partial class ExpressionContext : ParserRuleContext {
		public ExpressionContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_expression; } }
	 
		public ExpressionContext() { }
		public virtual void CopyFrom(ExpressionContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class ExpressionBinaryInSubqueryContext : ExpressionContext {
		public ExpressionContext left;
		public IToken op;
		public SelectQueryExpressionContext right;
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode IN() { return GetToken(QueryCatParser.IN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionContext selectQueryExpression() {
			return GetRuleContext<SelectQueryExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NOT() { return GetToken(QueryCatParser.NOT, 0); }
		public ExpressionBinaryInSubqueryContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionBinaryInSubquery(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionBinaryContext : ExpressionContext {
		public ExpressionContext left;
		public IToken op;
		public ExpressionContext right;
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext[] expression() {
			return GetRuleContexts<ExpressionContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression(int i) {
			return GetRuleContext<ExpressionContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode CONCAT() { return GetToken(QueryCatParser.CONCAT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LESS_LESS() { return GetToken(QueryCatParser.LESS_LESS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode GREATER_GREATER() { return GetToken(QueryCatParser.GREATER_GREATER, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STAR() { return GetToken(QueryCatParser.STAR, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DIV() { return GetToken(QueryCatParser.DIV, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MOD() { return GetToken(QueryCatParser.MOD, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode PLUS() { return GetToken(QueryCatParser.PLUS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MINUS() { return GetToken(QueryCatParser.MINUS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode EQUALS() { return GetToken(QueryCatParser.EQUALS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NOT_EQUALS() { return GetToken(QueryCatParser.NOT_EQUALS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode GREATER() { return GetToken(QueryCatParser.GREATER, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode GREATER_OR_EQUALS() { return GetToken(QueryCatParser.GREATER_OR_EQUALS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LESS() { return GetToken(QueryCatParser.LESS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LESS_OR_EQUALS() { return GetToken(QueryCatParser.LESS_OR_EQUALS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LIKE() { return GetToken(QueryCatParser.LIKE, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NOT() { return GetToken(QueryCatParser.NOT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TO() { return GetToken(QueryCatParser.TO, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SIMILAR() { return GetToken(QueryCatParser.SIMILAR, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode AND() { return GetToken(QueryCatParser.AND, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode OR() { return GetToken(QueryCatParser.OR, 0); }
		public ExpressionBinaryContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionBinary(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionStandardFunctionCallContext : ExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public StandardFunctionContext standardFunction() {
			return GetRuleContext<StandardFunctionContext>(0);
		}
		public ExpressionStandardFunctionCallContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionStandardFunctionCall(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionBlockContext : ExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public BlockExpressionContext blockExpression() {
			return GetRuleContext<BlockExpressionContext>(0);
		}
		public ExpressionBlockContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionBlock(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionInParensContext : ExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		public ExpressionInParensContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionInParens(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionAtTimeZoneContext : ExpressionContext {
		public ExpressionContext left;
		[System.Diagnostics.DebuggerNonUserCode] public AtTimeZoneContext atTimeZone() {
			return GetRuleContext<AtTimeZoneContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		public ExpressionAtTimeZoneContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionAtTimeZone(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionCaseContext : ExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public CaseExpressionContext caseExpression() {
			return GetRuleContext<CaseExpressionContext>(0);
		}
		public ExpressionCaseContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionCase(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionCastContext : ExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public CastOperandContext castOperand() {
			return GetRuleContext<CastOperandContext>(0);
		}
		public ExpressionCastContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionCast(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionBetweenContext : ExpressionContext {
		public ExpressionContext expr;
		public IToken op;
		public SimpleExpressionContext left;
		public ExpressionContext right;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode AND() { return GetToken(QueryCatParser.AND, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext[] expression() {
			return GetRuleContexts<ExpressionContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression(int i) {
			return GetRuleContext<ExpressionContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BETWEEN() { return GetToken(QueryCatParser.BETWEEN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NOT() { return GetToken(QueryCatParser.NOT, 0); }
		public ExpressionBetweenContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionBetween(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionUnaryContext : ExpressionContext {
		public ExpressionContext right;
		public IToken op;
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode PLUS() { return GetToken(QueryCatParser.PLUS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MINUS() { return GetToken(QueryCatParser.MINUS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NOT() { return GetToken(QueryCatParser.NOT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NULL() { return GetToken(QueryCatParser.NULL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode IS() { return GetToken(QueryCatParser.IS, 0); }
		public ExpressionUnaryContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionUnary(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionSubqueryContext : ExpressionContext {
		public SimpleExpressionContext left;
		public IToken op;
		public IToken condition;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionContext selectQueryExpression() {
			return GetRuleContext<SelectQueryExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode EQUALS() { return GetToken(QueryCatParser.EQUALS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NOT_EQUALS() { return GetToken(QueryCatParser.NOT_EQUALS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode GREATER() { return GetToken(QueryCatParser.GREATER, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode GREATER_OR_EQUALS() { return GetToken(QueryCatParser.GREATER_OR_EQUALS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LESS() { return GetToken(QueryCatParser.LESS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LESS_OR_EQUALS() { return GetToken(QueryCatParser.LESS_OR_EQUALS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ANY() { return GetToken(QueryCatParser.ANY, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SOME() { return GetToken(QueryCatParser.SOME, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ALL() { return GetToken(QueryCatParser.ALL, 0); }
		public ExpressionSubqueryContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionSubquery(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionBinaryInArrayContext : ExpressionContext {
		public ExpressionContext left;
		public IToken op;
		public ArrayContext right;
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode IN() { return GetToken(QueryCatParser.IN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ArrayContext array() {
			return GetRuleContext<ArrayContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NOT() { return GetToken(QueryCatParser.NOT, 0); }
		public ExpressionBinaryInArrayContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionBinaryInArray(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionBinaryCastContext : ExpressionContext {
		public ExpressionContext right;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TYPECAST() { return GetToken(QueryCatParser.TYPECAST, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public TypeContext type() {
			return GetRuleContext<TypeContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		public ExpressionBinaryCastContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionBinaryCast(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionSelectContext : ExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionContext selectQueryExpression() {
			return GetRuleContext<SelectQueryExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		public ExpressionSelectContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionSelect(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionIdentifierContext : ExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext identifier() {
			return GetRuleContext<IdentifierContext>(0);
		}
		public ExpressionIdentifierContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionIdentifier(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionLiteralContext : ExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public LiteralContext literal() {
			return GetRuleContext<LiteralContext>(0);
		}
		public ExpressionLiteralContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionLiteral(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionFunctionCallContext : ExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall() {
			return GetRuleContext<FunctionCallContext>(0);
		}
		public ExpressionFunctionCallContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionFunctionCall(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class ExpressionExistsContext : ExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode EXISTS() { return GetToken(QueryCatParser.EXISTS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SelectQueryExpressionContext selectQueryExpression() {
			return GetRuleContext<SelectQueryExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		public ExpressionExistsContext(ExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitExpressionExists(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public ExpressionContext expression() {
		return expression(0);
	}

	private ExpressionContext expression(int _p) {
		ParserRuleContext _parentctx = Context;
		int _parentState = State;
		ExpressionContext _localctx = new ExpressionContext(Context, _parentState);
		ExpressionContext _prevctx = _localctx;
		int _startState = 140;
		EnterRecursionRule(_localctx, 140, RULE_expression, _p);
		int _la;
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			State = 1013;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,133,Context) ) {
			case 1:
				{
				_localctx = new ExpressionLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;

				State = 982;
				literal();
				}
				break;
			case 2:
				{
				_localctx = new ExpressionCastContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 983;
				castOperand();
				}
				break;
			case 3:
				{
				_localctx = new ExpressionStandardFunctionCallContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 984;
				standardFunction();
				}
				break;
			case 4:
				{
				_localctx = new ExpressionFunctionCallContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 985;
				functionCall();
				}
				break;
			case 5:
				{
				_localctx = new ExpressionCaseContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 986;
				caseExpression();
				}
				break;
			case 6:
				{
				_localctx = new ExpressionIdentifierContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 987;
				identifier();
				}
				break;
			case 7:
				{
				_localctx = new ExpressionInParensContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 988;
				Match(LEFT_PAREN);
				State = 989;
				expression(0);
				State = 990;
				Match(RIGHT_PAREN);
				}
				break;
			case 8:
				{
				_localctx = new ExpressionSelectContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 992;
				Match(LEFT_PAREN);
				State = 993;
				selectQueryExpression();
				State = 994;
				Match(RIGHT_PAREN);
				}
				break;
			case 9:
				{
				_localctx = new ExpressionUnaryContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 996;
				((ExpressionUnaryContext)_localctx).op = TokenStream.LT(1);
				_la = TokenStream.LA(1);
				if ( !(_la==PLUS || _la==MINUS) ) {
					((ExpressionUnaryContext)_localctx).op = ErrorHandler.RecoverInline(this);
				}
				else {
					ErrorHandler.ReportMatch(this);
				    Consume();
				}
				State = 997;
				((ExpressionUnaryContext)_localctx).right = expression(17);
				}
				break;
			case 10:
				{
				_localctx = new ExpressionExistsContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 998;
				Match(EXISTS);
				State = 999;
				Match(LEFT_PAREN);
				State = 1000;
				selectQueryExpression();
				State = 1001;
				Match(RIGHT_PAREN);
				}
				break;
			case 11:
				{
				_localctx = new ExpressionSubqueryContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 1003;
				((ExpressionSubqueryContext)_localctx).left = simpleExpression(0);
				State = 1004;
				((ExpressionSubqueryContext)_localctx).op = TokenStream.LT(1);
				_la = TokenStream.LA(1);
				if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 528482304L) != 0)) ) {
					((ExpressionSubqueryContext)_localctx).op = ErrorHandler.RecoverInline(this);
				}
				else {
					ErrorHandler.ReportMatch(this);
				    Consume();
				}
				State = 1005;
				((ExpressionSubqueryContext)_localctx).condition = TokenStream.LT(1);
				_la = TokenStream.LA(1);
				if ( !(_la==ANY || _la==SOME || _la==ALL) ) {
					((ExpressionSubqueryContext)_localctx).condition = ErrorHandler.RecoverInline(this);
				}
				else {
					ErrorHandler.ReportMatch(this);
				    Consume();
				}
				State = 1006;
				Match(LEFT_PAREN);
				State = 1007;
				selectQueryExpression();
				State = 1008;
				Match(RIGHT_PAREN);
				}
				break;
			case 12:
				{
				_localctx = new ExpressionUnaryContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 1010;
				((ExpressionUnaryContext)_localctx).op = Match(NOT);
				State = 1011;
				((ExpressionUnaryContext)_localctx).right = expression(2);
				}
				break;
			case 13:
				{
				_localctx = new ExpressionBlockContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 1012;
				blockExpression();
				}
				break;
			}
			Context.Stop = TokenStream.LT(-1);
			State = 1083;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,141,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					if ( ParseListeners!=null )
						TriggerExitRuleEvent();
					_prevctx = _localctx;
					{
					State = 1081;
					ErrorHandler.Sync(this);
					switch ( Interpreter.AdaptivePredict(TokenStream,140,Context) ) {
					case 1:
						{
						_localctx = new ExpressionBinaryContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionBinaryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1015;
						if (!(Precpred(Context, 18))) throw new FailedPredicateException(this, "Precpred(Context, 18)");
						State = 1016;
						((ExpressionBinaryContext)_localctx).op = Match(CONCAT);
						State = 1017;
						((ExpressionBinaryContext)_localctx).right = expression(19);
						}
						break;
					case 2:
						{
						_localctx = new ExpressionBinaryContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionBinaryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1018;
						if (!(Precpred(Context, 16))) throw new FailedPredicateException(this, "Precpred(Context, 16)");
						State = 1019;
						((ExpressionBinaryContext)_localctx).op = TokenStream.LT(1);
						_la = TokenStream.LA(1);
						if ( !(_la==LESS_LESS || _la==GREATER_GREATER) ) {
							((ExpressionBinaryContext)_localctx).op = ErrorHandler.RecoverInline(this);
						}
						else {
							ErrorHandler.ReportMatch(this);
						    Consume();
						}
						State = 1020;
						((ExpressionBinaryContext)_localctx).right = expression(17);
						}
						break;
					case 3:
						{
						_localctx = new ExpressionBinaryContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionBinaryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1021;
						if (!(Precpred(Context, 15))) throw new FailedPredicateException(this, "Precpred(Context, 15)");
						State = 1022;
						((ExpressionBinaryContext)_localctx).op = TokenStream.LT(1);
						_la = TokenStream.LA(1);
						if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 7340032L) != 0)) ) {
							((ExpressionBinaryContext)_localctx).op = ErrorHandler.RecoverInline(this);
						}
						else {
							ErrorHandler.ReportMatch(this);
						    Consume();
						}
						State = 1023;
						((ExpressionBinaryContext)_localctx).right = expression(16);
						}
						break;
					case 4:
						{
						_localctx = new ExpressionBinaryContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionBinaryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1024;
						if (!(Precpred(Context, 14))) throw new FailedPredicateException(this, "Precpred(Context, 14)");
						State = 1025;
						((ExpressionBinaryContext)_localctx).op = TokenStream.LT(1);
						_la = TokenStream.LA(1);
						if ( !(_la==PLUS || _la==MINUS) ) {
							((ExpressionBinaryContext)_localctx).op = ErrorHandler.RecoverInline(this);
						}
						else {
							ErrorHandler.ReportMatch(this);
						    Consume();
						}
						State = 1026;
						((ExpressionBinaryContext)_localctx).right = expression(15);
						}
						break;
					case 5:
						{
						_localctx = new ExpressionBinaryContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionBinaryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1027;
						if (!(Precpred(Context, 13))) throw new FailedPredicateException(this, "Precpred(Context, 13)");
						State = 1028;
						((ExpressionBinaryContext)_localctx).op = TokenStream.LT(1);
						_la = TokenStream.LA(1);
						if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 528482304L) != 0)) ) {
							((ExpressionBinaryContext)_localctx).op = ErrorHandler.RecoverInline(this);
						}
						else {
							ErrorHandler.ReportMatch(this);
						    Consume();
						}
						State = 1029;
						((ExpressionBinaryContext)_localctx).right = expression(14);
						}
						break;
					case 6:
						{
						_localctx = new ExpressionBinaryContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionBinaryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1030;
						if (!(Precpred(Context, 12))) throw new FailedPredicateException(this, "Precpred(Context, 12)");
						State = 1032;
						ErrorHandler.Sync(this);
						_la = TokenStream.LA(1);
						if (_la==NOT) {
							{
							State = 1031;
							Match(NOT);
							}
						}

						State = 1034;
						((ExpressionBinaryContext)_localctx).op = Match(LIKE);
						State = 1035;
						((ExpressionBinaryContext)_localctx).right = expression(13);
						}
						break;
					case 7:
						{
						_localctx = new ExpressionBinaryContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionBinaryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1036;
						if (!(Precpred(Context, 11))) throw new FailedPredicateException(this, "Precpred(Context, 11)");
						State = 1038;
						ErrorHandler.Sync(this);
						_la = TokenStream.LA(1);
						if (_la==NOT) {
							{
							State = 1037;
							Match(NOT);
							}
						}

						State = 1040;
						((ExpressionBinaryContext)_localctx).op = Match(SIMILAR);
						State = 1041;
						Match(TO);
						State = 1042;
						((ExpressionBinaryContext)_localctx).right = expression(12);
						}
						break;
					case 8:
						{
						_localctx = new ExpressionBetweenContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionBetweenContext)_localctx).expr = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1043;
						if (!(Precpred(Context, 8))) throw new FailedPredicateException(this, "Precpred(Context, 8)");
						State = 1045;
						ErrorHandler.Sync(this);
						_la = TokenStream.LA(1);
						if (_la==NOT) {
							{
							State = 1044;
							Match(NOT);
							}
						}

						State = 1047;
						((ExpressionBetweenContext)_localctx).op = Match(BETWEEN);
						State = 1048;
						((ExpressionBetweenContext)_localctx).left = simpleExpression(0);
						State = 1049;
						Match(AND);
						State = 1050;
						((ExpressionBetweenContext)_localctx).right = expression(9);
						}
						break;
					case 9:
						{
						_localctx = new ExpressionBinaryContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionBinaryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1052;
						if (!(Precpred(Context, 5))) throw new FailedPredicateException(this, "Precpred(Context, 5)");
						State = 1053;
						((ExpressionBinaryContext)_localctx).op = Match(AND);
						State = 1054;
						((ExpressionBinaryContext)_localctx).right = expression(6);
						}
						break;
					case 10:
						{
						_localctx = new ExpressionBinaryContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionBinaryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1055;
						if (!(Precpred(Context, 4))) throw new FailedPredicateException(this, "Precpred(Context, 4)");
						State = 1056;
						((ExpressionBinaryContext)_localctx).op = Match(OR);
						State = 1057;
						((ExpressionBinaryContext)_localctx).right = expression(5);
						}
						break;
					case 11:
						{
						_localctx = new ExpressionBinaryCastContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionBinaryCastContext)_localctx).right = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1058;
						if (!(Precpred(Context, 26))) throw new FailedPredicateException(this, "Precpred(Context, 26)");
						State = 1059;
						Match(TYPECAST);
						State = 1060;
						type();
						}
						break;
					case 12:
						{
						_localctx = new ExpressionAtTimeZoneContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionAtTimeZoneContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1061;
						if (!(Precpred(Context, 25))) throw new FailedPredicateException(this, "Precpred(Context, 25)");
						State = 1062;
						atTimeZone();
						}
						break;
					case 13:
						{
						_localctx = new ExpressionBinaryInArrayContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionBinaryInArrayContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1063;
						if (!(Precpred(Context, 10))) throw new FailedPredicateException(this, "Precpred(Context, 10)");
						State = 1065;
						ErrorHandler.Sync(this);
						_la = TokenStream.LA(1);
						if (_la==NOT) {
							{
							State = 1064;
							Match(NOT);
							}
						}

						State = 1067;
						((ExpressionBinaryInArrayContext)_localctx).op = Match(IN);
						State = 1068;
						((ExpressionBinaryInArrayContext)_localctx).right = array();
						}
						break;
					case 14:
						{
						_localctx = new ExpressionBinaryInSubqueryContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionBinaryInSubqueryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1069;
						if (!(Precpred(Context, 9))) throw new FailedPredicateException(this, "Precpred(Context, 9)");
						State = 1071;
						ErrorHandler.Sync(this);
						_la = TokenStream.LA(1);
						if (_la==NOT) {
							{
							State = 1070;
							Match(NOT);
							}
						}

						State = 1073;
						((ExpressionBinaryInSubqueryContext)_localctx).op = Match(IN);
						State = 1074;
						((ExpressionBinaryInSubqueryContext)_localctx).right = selectQueryExpression();
						}
						break;
					case 15:
						{
						_localctx = new ExpressionUnaryContext(new ExpressionContext(_parentctx, _parentState));
						((ExpressionUnaryContext)_localctx).right = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_expression);
						State = 1075;
						if (!(Precpred(Context, 3))) throw new FailedPredicateException(this, "Precpred(Context, 3)");
						State = 1076;
						((ExpressionUnaryContext)_localctx).op = Match(IS);
						State = 1078;
						ErrorHandler.Sync(this);
						_la = TokenStream.LA(1);
						if (_la==NOT) {
							{
							State = 1077;
							Match(NOT);
							}
						}

						State = 1080;
						Match(NULL);
						}
						break;
					}
					} 
				}
				State = 1085;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,141,Context);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			UnrollRecursionContexts(_parentctx);
		}
		return _localctx;
	}

	public partial class SimpleExpressionContext : ParserRuleContext {
		public SimpleExpressionContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_simpleExpression; } }
	 
		public SimpleExpressionContext() { }
		public virtual void CopyFrom(SimpleExpressionContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class SimpleExpressionCaseContext : SimpleExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public CaseExpressionContext caseExpression() {
			return GetRuleContext<CaseExpressionContext>(0);
		}
		public SimpleExpressionCaseContext(SimpleExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSimpleExpressionCase(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SimpleExpressionLiteralContext : SimpleExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public LiteralContext literal() {
			return GetRuleContext<LiteralContext>(0);
		}
		public SimpleExpressionLiteralContext(SimpleExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSimpleExpressionLiteral(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SimpleExpressionCastContext : SimpleExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public CastOperandContext castOperand() {
			return GetRuleContext<CastOperandContext>(0);
		}
		public SimpleExpressionCastContext(SimpleExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSimpleExpressionCast(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SimpleExpressionAtTimeZoneContext : SimpleExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public AtTimeZoneContext atTimeZone() {
			return GetRuleContext<AtTimeZoneContext>(0);
		}
		public SimpleExpressionAtTimeZoneContext(SimpleExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSimpleExpressionAtTimeZone(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SimpleExpressionStandardFunctionCallContext : SimpleExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public StandardFunctionContext standardFunction() {
			return GetRuleContext<StandardFunctionContext>(0);
		}
		public SimpleExpressionStandardFunctionCallContext(SimpleExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSimpleExpressionStandardFunctionCall(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SimpleExpressionUnaryContext : SimpleExpressionContext {
		public IToken op;
		public ExpressionContext right;
		[System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression() {
			return GetRuleContext<ExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode PLUS() { return GetToken(QueryCatParser.PLUS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MINUS() { return GetToken(QueryCatParser.MINUS, 0); }
		public SimpleExpressionUnaryContext(SimpleExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSimpleExpressionUnary(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SimpleExpressionBinaryContext : SimpleExpressionContext {
		public SimpleExpressionContext left;
		public IToken op;
		public SimpleExpressionContext right;
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext[] simpleExpression() {
			return GetRuleContexts<SimpleExpressionContext>();
		}
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression(int i) {
			return GetRuleContext<SimpleExpressionContext>(i);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode CONCAT() { return GetToken(QueryCatParser.CONCAT, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STAR() { return GetToken(QueryCatParser.STAR, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DIV() { return GetToken(QueryCatParser.DIV, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MOD() { return GetToken(QueryCatParser.MOD, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode PLUS() { return GetToken(QueryCatParser.PLUS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MINUS() { return GetToken(QueryCatParser.MINUS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode EQUALS() { return GetToken(QueryCatParser.EQUALS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NOT_EQUALS() { return GetToken(QueryCatParser.NOT_EQUALS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode GREATER() { return GetToken(QueryCatParser.GREATER, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode GREATER_OR_EQUALS() { return GetToken(QueryCatParser.GREATER_OR_EQUALS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LESS() { return GetToken(QueryCatParser.LESS, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LESS_OR_EQUALS() { return GetToken(QueryCatParser.LESS_OR_EQUALS, 0); }
		public SimpleExpressionBinaryContext(SimpleExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSimpleExpressionBinary(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SimpleExpressionBinaryCastContext : SimpleExpressionContext {
		public SimpleExpressionContext right;
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TYPECAST() { return GetToken(QueryCatParser.TYPECAST, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public TypeContext type() {
			return GetRuleContext<TypeContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		public SimpleExpressionBinaryCastContext(SimpleExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSimpleExpressionBinaryCast(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SimpleExpressionFunctionCallContext : SimpleExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public FunctionCallContext functionCall() {
			return GetRuleContext<FunctionCallContext>(0);
		}
		public SimpleExpressionFunctionCallContext(SimpleExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSimpleExpressionFunctionCall(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SimpleExpressionInParensContext : SimpleExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LEFT_PAREN() { return GetToken(QueryCatParser.LEFT_PAREN, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public SimpleExpressionContext simpleExpression() {
			return GetRuleContext<SimpleExpressionContext>(0);
		}
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RIGHT_PAREN() { return GetToken(QueryCatParser.RIGHT_PAREN, 0); }
		public SimpleExpressionInParensContext(SimpleExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSimpleExpressionInParens(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class SimpleExpressionIdentifierContext : SimpleExpressionContext {
		[System.Diagnostics.DebuggerNonUserCode] public IdentifierContext identifier() {
			return GetRuleContext<IdentifierContext>(0);
		}
		public SimpleExpressionIdentifierContext(SimpleExpressionContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitSimpleExpressionIdentifier(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public SimpleExpressionContext simpleExpression() {
		return simpleExpression(0);
	}

	private SimpleExpressionContext simpleExpression(int _p) {
		ParserRuleContext _parentctx = Context;
		int _parentState = State;
		SimpleExpressionContext _localctx = new SimpleExpressionContext(Context, _parentState);
		SimpleExpressionContext _prevctx = _localctx;
		int _startState = 142;
		EnterRecursionRule(_localctx, 142, RULE_simpleExpression, _p);
		int _la;
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			State = 1100;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,142,Context) ) {
			case 1:
				{
				_localctx = new SimpleExpressionLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;

				State = 1087;
				literal();
				}
				break;
			case 2:
				{
				_localctx = new SimpleExpressionCastContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 1088;
				castOperand();
				}
				break;
			case 3:
				{
				_localctx = new SimpleExpressionAtTimeZoneContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 1089;
				atTimeZone();
				}
				break;
			case 4:
				{
				_localctx = new SimpleExpressionStandardFunctionCallContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 1090;
				standardFunction();
				}
				break;
			case 5:
				{
				_localctx = new SimpleExpressionFunctionCallContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 1091;
				functionCall();
				}
				break;
			case 6:
				{
				_localctx = new SimpleExpressionCaseContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 1092;
				caseExpression();
				}
				break;
			case 7:
				{
				_localctx = new SimpleExpressionIdentifierContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 1093;
				identifier();
				}
				break;
			case 8:
				{
				_localctx = new SimpleExpressionInParensContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 1094;
				Match(LEFT_PAREN);
				State = 1095;
				simpleExpression(0);
				State = 1096;
				Match(RIGHT_PAREN);
				}
				break;
			case 9:
				{
				_localctx = new SimpleExpressionUnaryContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 1098;
				((SimpleExpressionUnaryContext)_localctx).op = TokenStream.LT(1);
				_la = TokenStream.LA(1);
				if ( !(_la==PLUS || _la==MINUS) ) {
					((SimpleExpressionUnaryContext)_localctx).op = ErrorHandler.RecoverInline(this);
				}
				else {
					ErrorHandler.ReportMatch(this);
				    Consume();
				}
				State = 1099;
				((SimpleExpressionUnaryContext)_localctx).right = expression(0);
				}
				break;
			}
			Context.Stop = TokenStream.LT(-1);
			State = 1119;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,144,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					if ( ParseListeners!=null )
						TriggerExitRuleEvent();
					_prevctx = _localctx;
					{
					State = 1117;
					ErrorHandler.Sync(this);
					switch ( Interpreter.AdaptivePredict(TokenStream,143,Context) ) {
					case 1:
						{
						_localctx = new SimpleExpressionBinaryContext(new SimpleExpressionContext(_parentctx, _parentState));
						((SimpleExpressionBinaryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_simpleExpression);
						State = 1102;
						if (!(Precpred(Context, 4))) throw new FailedPredicateException(this, "Precpred(Context, 4)");
						State = 1103;
						((SimpleExpressionBinaryContext)_localctx).op = Match(CONCAT);
						State = 1104;
						((SimpleExpressionBinaryContext)_localctx).right = simpleExpression(5);
						}
						break;
					case 2:
						{
						_localctx = new SimpleExpressionBinaryContext(new SimpleExpressionContext(_parentctx, _parentState));
						((SimpleExpressionBinaryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_simpleExpression);
						State = 1105;
						if (!(Precpred(Context, 3))) throw new FailedPredicateException(this, "Precpred(Context, 3)");
						State = 1106;
						((SimpleExpressionBinaryContext)_localctx).op = TokenStream.LT(1);
						_la = TokenStream.LA(1);
						if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 7340032L) != 0)) ) {
							((SimpleExpressionBinaryContext)_localctx).op = ErrorHandler.RecoverInline(this);
						}
						else {
							ErrorHandler.ReportMatch(this);
						    Consume();
						}
						State = 1107;
						((SimpleExpressionBinaryContext)_localctx).right = simpleExpression(4);
						}
						break;
					case 3:
						{
						_localctx = new SimpleExpressionBinaryContext(new SimpleExpressionContext(_parentctx, _parentState));
						((SimpleExpressionBinaryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_simpleExpression);
						State = 1108;
						if (!(Precpred(Context, 2))) throw new FailedPredicateException(this, "Precpred(Context, 2)");
						State = 1109;
						((SimpleExpressionBinaryContext)_localctx).op = TokenStream.LT(1);
						_la = TokenStream.LA(1);
						if ( !(_la==PLUS || _la==MINUS) ) {
							((SimpleExpressionBinaryContext)_localctx).op = ErrorHandler.RecoverInline(this);
						}
						else {
							ErrorHandler.ReportMatch(this);
						    Consume();
						}
						State = 1110;
						((SimpleExpressionBinaryContext)_localctx).right = simpleExpression(3);
						}
						break;
					case 4:
						{
						_localctx = new SimpleExpressionBinaryContext(new SimpleExpressionContext(_parentctx, _parentState));
						((SimpleExpressionBinaryContext)_localctx).left = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_simpleExpression);
						State = 1111;
						if (!(Precpred(Context, 1))) throw new FailedPredicateException(this, "Precpred(Context, 1)");
						State = 1112;
						((SimpleExpressionBinaryContext)_localctx).op = TokenStream.LT(1);
						_la = TokenStream.LA(1);
						if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 528482304L) != 0)) ) {
							((SimpleExpressionBinaryContext)_localctx).op = ErrorHandler.RecoverInline(this);
						}
						else {
							ErrorHandler.ReportMatch(this);
						    Consume();
						}
						State = 1113;
						((SimpleExpressionBinaryContext)_localctx).right = simpleExpression(2);
						}
						break;
					case 5:
						{
						_localctx = new SimpleExpressionBinaryCastContext(new SimpleExpressionContext(_parentctx, _parentState));
						((SimpleExpressionBinaryCastContext)_localctx).right = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_simpleExpression);
						State = 1114;
						if (!(Precpred(Context, 12))) throw new FailedPredicateException(this, "Precpred(Context, 12)");
						State = 1115;
						Match(TYPECAST);
						State = 1116;
						type();
						}
						break;
					}
					} 
				}
				State = 1121;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,144,Context);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			UnrollRecursionContexts(_parentctx);
		}
		return _localctx;
	}

	public partial class LiteralContext : ParserRuleContext {
		public LiteralContext(ParserRuleContext parent, int invokingState)
			: base(parent, invokingState)
		{
		}
		public override int RuleIndex { get { return RULE_literal; } }
	 
		public LiteralContext() { }
		public virtual void CopyFrom(LiteralContext context) {
			base.CopyFrom(context);
		}
	}
	public partial class LiteralPlainContext : LiteralContext {
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INTEGER_LITERAL() { return GetToken(QueryCatParser.INTEGER_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FLOAT_LITERAL() { return GetToken(QueryCatParser.FLOAT_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NUMERIC_LITERAL() { return GetToken(QueryCatParser.NUMERIC_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BOOLEAN_LITERAL() { return GetToken(QueryCatParser.BOOLEAN_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING_LITERAL() { return GetToken(QueryCatParser.STRING_LITERAL, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TRUE() { return GetToken(QueryCatParser.TRUE, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FALSE() { return GetToken(QueryCatParser.FALSE, 0); }
		[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NULL() { return GetToken(QueryCatParser.NULL, 0); }
		public LiteralPlainContext(LiteralContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitLiteralPlain(this);
			else return visitor.VisitChildren(this);
		}
	}
	public partial class LiteralIntervalContext : LiteralContext {
		[System.Diagnostics.DebuggerNonUserCode] public IntervalLiteralContext intervalLiteral() {
			return GetRuleContext<IntervalLiteralContext>(0);
		}
		public LiteralIntervalContext(LiteralContext context) { CopyFrom(context); }
		[System.Diagnostics.DebuggerNonUserCode]
		public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
			IQueryCatParserVisitor<TResult> typedVisitor = visitor as IQueryCatParserVisitor<TResult>;
			if (typedVisitor != null) return typedVisitor.VisitLiteralInterval(this);
			else return visitor.VisitChildren(this);
		}
	}

	[RuleVersion(0)]
	public LiteralContext literal() {
		LiteralContext _localctx = new LiteralContext(Context, State);
		EnterRule(_localctx, 144, RULE_literal);
		try {
			State = 1131;
			ErrorHandler.Sync(this);
			switch (TokenStream.LA(1)) {
			case INTEGER_LITERAL:
				_localctx = new LiteralPlainContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 1122;
				Match(INTEGER_LITERAL);
				}
				break;
			case FLOAT_LITERAL:
				_localctx = new LiteralPlainContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 1123;
				Match(FLOAT_LITERAL);
				}
				break;
			case NUMERIC_LITERAL:
				_localctx = new LiteralPlainContext(_localctx);
				EnterOuterAlt(_localctx, 3);
				{
				State = 1124;
				Match(NUMERIC_LITERAL);
				}
				break;
			case BOOLEAN_LITERAL:
				_localctx = new LiteralPlainContext(_localctx);
				EnterOuterAlt(_localctx, 4);
				{
				State = 1125;
				Match(BOOLEAN_LITERAL);
				}
				break;
			case STRING_LITERAL:
				_localctx = new LiteralPlainContext(_localctx);
				EnterOuterAlt(_localctx, 5);
				{
				State = 1126;
				Match(STRING_LITERAL);
				}
				break;
			case TRUE:
				_localctx = new LiteralPlainContext(_localctx);
				EnterOuterAlt(_localctx, 6);
				{
				State = 1127;
				Match(TRUE);
				}
				break;
			case FALSE:
				_localctx = new LiteralPlainContext(_localctx);
				EnterOuterAlt(_localctx, 7);
				{
				State = 1128;
				Match(FALSE);
				}
				break;
			case NULL:
				_localctx = new LiteralPlainContext(_localctx);
				EnterOuterAlt(_localctx, 8);
				{
				State = 1129;
				Match(NULL);
				}
				break;
			case INTERVAL:
				_localctx = new LiteralIntervalContext(_localctx);
				EnterOuterAlt(_localctx, 9);
				{
				State = 1130;
				intervalLiteral();
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}

	public override bool Sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
		switch (ruleIndex) {
		case 14: return selectQueryExpressionBody_sempred((SelectQueryExpressionBodyContext)_localctx, predIndex);
		case 70: return expression_sempred((ExpressionContext)_localctx, predIndex);
		case 71: return simpleExpression_sempred((SimpleExpressionContext)_localctx, predIndex);
		}
		return true;
	}
	private bool selectQueryExpressionBody_sempred(SelectQueryExpressionBodyContext _localctx, int predIndex) {
		switch (predIndex) {
		case 0: return Precpred(Context, 2);
		case 1: return Precpred(Context, 1);
		}
		return true;
	}
	private bool expression_sempred(ExpressionContext _localctx, int predIndex) {
		switch (predIndex) {
		case 2: return Precpred(Context, 18);
		case 3: return Precpred(Context, 16);
		case 4: return Precpred(Context, 15);
		case 5: return Precpred(Context, 14);
		case 6: return Precpred(Context, 13);
		case 7: return Precpred(Context, 12);
		case 8: return Precpred(Context, 11);
		case 9: return Precpred(Context, 8);
		case 10: return Precpred(Context, 5);
		case 11: return Precpred(Context, 4);
		case 12: return Precpred(Context, 26);
		case 13: return Precpred(Context, 25);
		case 14: return Precpred(Context, 10);
		case 15: return Precpred(Context, 9);
		case 16: return Precpred(Context, 3);
		}
		return true;
	}
	private bool simpleExpression_sempred(SimpleExpressionContext _localctx, int predIndex) {
		switch (predIndex) {
		case 17: return Precpred(Context, 4);
		case 18: return Precpred(Context, 3);
		case 19: return Precpred(Context, 2);
		case 20: return Precpred(Context, 1);
		case 21: return Precpred(Context, 12);
		}
		return true;
	}

	private static int[] _serializedATN = {
		4,1,169,1134,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,
		7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,
		2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,
		2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,
		2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,
		2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,
		2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,
		2,50,7,50,2,51,7,51,2,52,7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,
		2,57,7,57,2,58,7,58,2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,
		2,64,7,64,2,65,7,65,2,66,7,66,2,67,7,67,2,68,7,68,2,69,7,69,2,70,7,70,
		2,71,7,71,2,72,7,72,1,0,5,0,148,8,0,10,0,12,0,151,9,0,1,0,1,0,1,0,5,0,
		156,8,0,10,0,12,0,159,9,0,1,0,5,0,162,8,0,10,0,12,0,165,9,0,1,0,1,0,1,
		1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,179,8,1,1,2,1,2,1,2,1,2,1,2,
		5,2,186,8,2,10,2,12,2,189,9,2,3,2,191,8,2,1,2,1,2,1,2,3,2,196,8,2,1,2,
		1,2,1,3,1,3,1,3,1,3,1,3,3,3,205,8,3,1,4,3,4,208,8,4,1,4,1,4,3,4,212,8,
		4,1,4,1,4,1,4,3,4,217,8,4,1,4,1,4,3,4,221,8,4,1,5,1,5,1,5,1,5,1,5,5,5,
		228,8,5,10,5,12,5,231,9,5,3,5,233,8,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,3,5,
		242,8,5,1,6,1,6,1,6,3,6,247,8,6,1,6,1,6,1,7,1,7,1,7,1,7,1,7,3,7,256,8,
		7,1,8,1,8,1,8,1,8,1,8,1,9,1,9,1,10,1,10,1,10,1,10,1,10,5,10,270,8,10,10,
		10,12,10,273,9,10,1,11,1,11,3,11,277,8,11,1,11,1,11,1,11,1,11,3,11,283,
		8,11,1,12,3,12,286,8,12,1,12,1,12,3,12,290,8,12,1,13,3,13,293,8,13,1,13,
		1,13,3,13,297,8,13,1,13,3,13,300,8,13,1,13,1,13,3,13,304,8,13,1,13,3,13,
		307,8,13,1,13,3,13,310,8,13,1,13,3,13,313,8,13,1,13,3,13,316,8,13,1,13,
		3,13,319,8,13,1,13,3,13,322,8,13,1,13,3,13,325,8,13,1,13,3,13,328,8,13,
		1,13,1,13,3,13,332,8,13,1,13,3,13,335,8,13,1,13,3,13,338,8,13,1,13,3,13,
		341,8,13,3,13,343,8,13,1,14,1,14,1,14,1,14,1,14,1,14,3,14,351,8,14,1,14,
		1,14,1,14,1,14,3,14,357,8,14,1,14,5,14,360,8,14,10,14,12,14,363,9,14,1,
		15,1,15,1,15,1,15,1,15,3,15,370,8,15,1,16,3,16,373,8,16,1,16,1,16,3,16,
		377,8,16,1,16,3,16,380,8,16,1,16,1,16,3,16,384,8,16,1,16,3,16,387,8,16,
		1,16,1,16,3,16,391,8,16,1,16,1,16,1,16,1,16,5,16,397,8,16,10,16,12,16,
		400,9,16,1,16,3,16,403,8,16,3,16,405,8,16,1,17,1,17,1,17,5,17,410,8,17,
		10,17,12,17,413,9,17,1,18,1,18,1,18,1,18,5,18,419,8,18,10,18,12,18,422,
		9,18,1,19,1,19,1,19,3,19,427,8,19,1,20,1,20,1,20,1,20,1,20,1,20,5,20,435,
		8,20,10,20,12,20,438,9,20,1,20,1,20,1,21,1,21,3,21,444,8,21,1,21,1,21,
		1,21,5,21,449,8,21,10,21,12,21,452,9,21,1,22,1,22,1,22,1,22,1,22,3,22,
		459,8,22,1,22,1,22,1,22,1,22,1,22,1,23,1,23,1,23,5,23,469,8,23,10,23,12,
		23,472,9,23,1,24,1,24,1,24,1,24,1,24,3,24,479,8,24,1,24,3,24,482,8,24,
		1,24,1,24,3,24,486,8,24,3,24,488,8,24,1,25,1,25,1,25,3,25,493,8,25,1,25,
		1,25,3,25,497,8,25,1,26,1,26,3,26,501,8,26,1,26,3,26,504,8,26,1,26,3,26,
		507,8,26,1,27,1,27,1,27,1,27,5,27,513,8,27,10,27,12,27,516,9,27,1,28,1,
		28,5,28,520,8,28,10,28,12,28,523,9,28,1,29,1,29,1,29,1,29,5,29,529,8,29,
		10,29,12,29,532,9,29,1,29,1,29,1,30,1,30,1,30,1,30,5,30,540,8,30,10,30,
		12,30,543,9,30,1,31,1,31,1,31,3,31,548,8,31,1,31,3,31,551,8,31,1,31,1,
		31,1,31,3,31,556,8,31,1,31,3,31,559,8,31,1,31,1,31,1,31,3,31,564,8,31,
		1,31,3,31,567,8,31,1,31,1,31,1,31,1,31,3,31,573,8,31,1,31,1,31,1,31,3,
		31,578,8,31,1,31,3,31,581,8,31,1,31,1,31,1,31,1,31,3,31,587,8,31,1,31,
		1,31,3,31,591,8,31,3,31,593,8,31,1,32,3,32,596,8,32,1,32,1,32,1,32,1,32,
		1,32,1,32,3,32,604,8,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,5,32,613,8,
		32,10,32,12,32,616,9,32,1,32,1,32,3,32,620,8,32,1,33,1,33,1,33,3,33,625,
		8,33,3,33,627,8,33,1,34,1,34,1,34,1,34,1,34,5,34,634,8,34,10,34,12,34,
		637,9,34,1,35,1,35,1,35,1,36,1,36,1,36,1,37,1,37,3,37,647,8,37,1,37,3,
		37,650,8,37,1,37,3,37,653,8,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,5,38,
		662,8,38,10,38,12,38,665,9,38,1,39,1,39,1,39,1,39,1,39,5,39,672,8,39,10,
		39,12,39,675,9,39,1,40,1,40,1,40,1,40,5,40,681,8,40,10,40,12,40,684,9,
		40,1,41,1,41,1,41,1,41,1,42,1,42,1,42,3,42,693,8,42,1,43,1,43,3,43,697,
		8,43,1,43,1,43,3,43,701,8,43,1,43,3,43,704,8,43,1,44,1,44,1,44,1,45,1,
		45,1,45,1,46,1,46,1,46,1,46,1,46,1,46,5,46,718,8,46,10,46,12,46,721,9,
		46,1,46,3,46,724,8,46,1,47,1,47,3,47,728,8,47,1,47,1,47,1,47,3,47,733,
		8,47,1,47,3,47,736,8,47,1,48,1,48,1,48,1,48,1,49,1,49,1,49,1,49,3,49,746,
		8,49,1,49,1,49,1,50,1,50,1,50,1,50,3,50,754,8,50,1,50,3,50,757,8,50,1,
		51,1,51,1,51,1,51,5,51,763,8,51,10,51,12,51,766,9,51,1,51,1,51,1,52,1,
		52,3,52,772,8,52,1,53,1,53,1,53,1,54,1,54,1,54,1,55,1,55,1,55,1,55,5,55,
		784,8,55,10,55,12,55,787,9,55,1,55,1,55,3,55,791,8,55,1,56,1,56,1,56,1,
		56,1,57,1,57,1,57,3,57,800,8,57,1,58,1,58,5,58,804,8,58,10,58,12,58,807,
		9,58,1,58,3,58,810,8,58,1,59,1,59,1,59,1,59,1,59,1,59,5,59,818,8,59,10,
		59,12,59,821,9,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,3,59,830,8,59,1,60,
		1,60,1,60,1,60,5,60,836,8,60,10,60,12,60,839,9,60,1,60,1,60,1,61,1,61,
		1,61,1,62,1,62,5,62,848,8,62,10,62,12,62,851,9,62,1,62,1,62,1,62,5,62,
		856,8,62,10,62,12,62,859,9,62,1,62,5,62,862,8,62,10,62,12,62,865,9,62,
		1,62,1,62,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,64,1,64,1,64,1,64,1,64,
		3,64,881,8,64,1,65,1,65,3,65,885,8,65,1,65,5,65,888,8,65,10,65,12,65,891,
		9,65,1,65,1,65,3,65,895,8,65,1,65,1,65,1,66,1,66,1,66,1,66,1,66,1,67,1,
		67,1,67,1,67,1,67,3,67,909,8,67,1,67,3,67,912,8,67,1,67,3,67,915,8,67,
		1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,
		1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,5,67,939,8,67,10,67,12,67,942,
		9,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,
		1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,
		1,67,1,67,1,67,1,67,1,67,3,67,976,8,67,1,68,1,68,1,69,1,69,1,70,1,70,1,
		70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,
		70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,
		70,1,70,3,70,1014,8,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,
		70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,3,70,1033,8,70,1,70,1,70,1,70,1,
		70,3,70,1039,8,70,1,70,1,70,1,70,1,70,1,70,3,70,1046,8,70,1,70,1,70,1,
		70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,
		70,1,70,3,70,1066,8,70,1,70,1,70,1,70,1,70,3,70,1072,8,70,1,70,1,70,1,
		70,1,70,1,70,3,70,1079,8,70,1,70,5,70,1082,8,70,10,70,12,70,1085,9,70,
		1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,
		3,71,1101,8,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,
		1,71,1,71,1,71,1,71,5,71,1118,8,71,10,71,12,71,1121,9,71,1,72,1,72,1,72,
		1,72,1,72,1,72,1,72,1,72,1,72,3,72,1132,8,72,1,72,0,3,28,140,142,73,0,
		2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,
		52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,
		100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,
		136,138,140,142,144,0,17,3,0,3,3,23,23,54,54,2,0,105,105,108,108,2,0,104,
		104,109,109,2,0,110,110,141,141,3,0,115,115,123,123,134,134,1,0,135,136,
		2,0,111,111,124,124,2,0,112,112,125,125,1,0,66,66,1,0,74,76,1,0,80,90,
		3,0,33,47,72,72,79,79,1,0,18,19,1,0,23,28,3,0,33,33,68,68,104,104,1,0,
		30,31,1,0,20,22,1275,0,149,1,0,0,0,2,178,1,0,0,0,4,180,1,0,0,0,6,199,1,
		0,0,0,8,207,1,0,0,0,10,241,1,0,0,0,12,246,1,0,0,0,14,250,1,0,0,0,16,257,
		1,0,0,0,18,262,1,0,0,0,20,264,1,0,0,0,22,274,1,0,0,0,24,285,1,0,0,0,26,
		342,1,0,0,0,28,344,1,0,0,0,30,369,1,0,0,0,32,404,1,0,0,0,34,406,1,0,0,
		0,36,414,1,0,0,0,38,426,1,0,0,0,40,428,1,0,0,0,42,441,1,0,0,0,44,453,1,
		0,0,0,46,465,1,0,0,0,48,487,1,0,0,0,50,489,1,0,0,0,52,498,1,0,0,0,54,508,
		1,0,0,0,56,517,1,0,0,0,58,524,1,0,0,0,60,535,1,0,0,0,62,592,1,0,0,0,64,
		619,1,0,0,0,66,626,1,0,0,0,68,628,1,0,0,0,70,638,1,0,0,0,72,641,1,0,0,
		0,74,644,1,0,0,0,76,656,1,0,0,0,78,666,1,0,0,0,80,676,1,0,0,0,82,685,1,
		0,0,0,84,689,1,0,0,0,86,694,1,0,0,0,88,705,1,0,0,0,90,708,1,0,0,0,92,711,
		1,0,0,0,94,735,1,0,0,0,96,737,1,0,0,0,98,741,1,0,0,0,100,756,1,0,0,0,102,
		758,1,0,0,0,104,771,1,0,0,0,106,773,1,0,0,0,108,776,1,0,0,0,110,779,1,
		0,0,0,112,792,1,0,0,0,114,799,1,0,0,0,116,809,1,0,0,0,118,829,1,0,0,0,
		120,831,1,0,0,0,122,842,1,0,0,0,124,845,1,0,0,0,126,868,1,0,0,0,128,875,
		1,0,0,0,130,882,1,0,0,0,132,898,1,0,0,0,134,975,1,0,0,0,136,977,1,0,0,
		0,138,979,1,0,0,0,140,1013,1,0,0,0,142,1100,1,0,0,0,144,1131,1,0,0,0,146,
		148,5,9,0,0,147,146,1,0,0,0,148,151,1,0,0,0,149,147,1,0,0,0,149,150,1,
		0,0,0,150,152,1,0,0,0,151,149,1,0,0,0,152,157,3,2,1,0,153,154,5,9,0,0,
		154,156,3,2,1,0,155,153,1,0,0,0,156,159,1,0,0,0,157,155,1,0,0,0,157,158,
		1,0,0,0,158,163,1,0,0,0,159,157,1,0,0,0,160,162,5,9,0,0,161,160,1,0,0,
		0,162,165,1,0,0,0,163,161,1,0,0,0,163,164,1,0,0,0,164,166,1,0,0,0,165,
		163,1,0,0,0,166,167,5,0,0,1,167,1,1,0,0,0,168,179,3,10,5,0,169,179,3,14,
		7,0,170,179,3,16,8,0,171,179,3,18,9,0,172,179,3,92,46,0,173,179,3,98,49,
		0,174,179,3,106,53,0,175,179,3,108,54,0,176,179,3,110,55,0,177,179,3,140,
		70,0,178,168,1,0,0,0,178,169,1,0,0,0,178,170,1,0,0,0,178,171,1,0,0,0,178,
		172,1,0,0,0,178,173,1,0,0,0,178,174,1,0,0,0,178,175,1,0,0,0,178,176,1,
		0,0,0,178,177,1,0,0,0,179,3,1,0,0,0,180,181,3,114,57,0,181,190,5,1,0,0,
		182,187,3,8,4,0,183,184,5,6,0,0,184,186,3,8,4,0,185,183,1,0,0,0,186,189,
		1,0,0,0,187,185,1,0,0,0,187,188,1,0,0,0,188,191,1,0,0,0,189,187,1,0,0,
		0,190,182,1,0,0,0,190,191,1,0,0,0,191,192,1,0,0,0,192,195,5,2,0,0,193,
		194,5,5,0,0,194,196,3,6,3,0,195,193,1,0,0,0,195,196,1,0,0,0,196,197,1,
		0,0,0,197,198,5,0,0,1,198,5,1,0,0,0,199,204,3,138,69,0,200,201,5,27,0,
		0,201,202,3,114,57,0,202,203,5,25,0,0,203,205,1,0,0,0,204,200,1,0,0,0,
		204,205,1,0,0,0,205,7,1,0,0,0,206,208,5,8,0,0,207,206,1,0,0,0,207,208,
		1,0,0,0,208,209,1,0,0,0,209,211,3,114,57,0,210,212,5,10,0,0,211,210,1,
		0,0,0,211,212,1,0,0,0,212,213,1,0,0,0,213,214,5,5,0,0,214,216,3,6,3,0,
		215,217,5,13,0,0,216,215,1,0,0,0,216,217,1,0,0,0,217,220,1,0,0,0,218,219,
		7,0,0,0,219,221,3,144,72,0,220,218,1,0,0,0,220,221,1,0,0,0,221,9,1,0,0,
		0,222,223,3,114,57,0,223,232,5,1,0,0,224,229,3,12,6,0,225,226,5,6,0,0,
		226,228,3,12,6,0,227,225,1,0,0,0,228,231,1,0,0,0,229,227,1,0,0,0,229,230,
		1,0,0,0,230,233,1,0,0,0,231,229,1,0,0,0,232,224,1,0,0,0,232,233,1,0,0,
		0,233,234,1,0,0,0,234,235,5,2,0,0,235,242,1,0,0,0,236,237,3,114,57,0,237,
		238,5,1,0,0,238,239,5,20,0,0,239,240,5,2,0,0,240,242,1,0,0,0,241,222,1,
		0,0,0,241,236,1,0,0,0,242,11,1,0,0,0,243,244,3,114,57,0,244,245,5,4,0,
		0,245,247,1,0,0,0,246,243,1,0,0,0,246,247,1,0,0,0,247,248,1,0,0,0,248,
		249,3,140,70,0,249,13,1,0,0,0,250,251,5,148,0,0,251,252,3,114,57,0,252,
		255,3,138,69,0,253,254,5,3,0,0,254,256,3,2,1,0,255,253,1,0,0,0,255,256,
		1,0,0,0,256,15,1,0,0,0,257,258,5,149,0,0,258,259,3,116,58,0,259,260,5,
		3,0,0,260,261,3,2,1,0,261,17,1,0,0,0,262,263,3,26,13,0,263,19,1,0,0,0,
		264,265,5,128,0,0,265,266,5,52,0,0,266,271,3,22,11,0,267,268,5,6,0,0,268,
		270,3,22,11,0,269,267,1,0,0,0,270,273,1,0,0,0,271,269,1,0,0,0,271,272,
		1,0,0,0,272,21,1,0,0,0,273,271,1,0,0,0,274,276,3,140,70,0,275,277,7,1,
		0,0,276,275,1,0,0,0,276,277,1,0,0,0,277,282,1,0,0,0,278,279,5,126,0,0,
		279,283,5,112,0,0,280,281,5,126,0,0,281,283,5,122,0,0,282,278,1,0,0,0,
		282,280,1,0,0,0,282,283,1,0,0,0,283,23,1,0,0,0,284,286,5,49,0,0,285,284,
		1,0,0,0,285,286,1,0,0,0,286,289,1,0,0,0,287,290,3,114,57,0,288,290,5,165,
		0,0,289,287,1,0,0,0,289,288,1,0,0,0,290,25,1,0,0,0,291,293,3,42,21,0,292,
		291,1,0,0,0,292,293,1,0,0,0,293,294,1,0,0,0,294,296,5,137,0,0,295,297,
		3,88,44,0,296,295,1,0,0,0,296,297,1,0,0,0,297,299,1,0,0,0,298,300,3,38,
		19,0,299,298,1,0,0,0,299,300,1,0,0,0,300,301,1,0,0,0,301,303,3,34,17,0,
		302,304,3,36,18,0,303,302,1,0,0,0,303,304,1,0,0,0,304,306,1,0,0,0,305,
		307,3,50,25,0,306,305,1,0,0,0,306,307,1,0,0,0,307,309,1,0,0,0,308,310,
		3,52,26,0,309,308,1,0,0,0,309,310,1,0,0,0,310,312,1,0,0,0,311,313,3,80,
		40,0,312,311,1,0,0,0,312,313,1,0,0,0,313,315,1,0,0,0,314,316,3,20,10,0,
		315,314,1,0,0,0,315,316,1,0,0,0,316,318,1,0,0,0,317,319,3,90,45,0,318,
		317,1,0,0,0,318,319,1,0,0,0,319,321,1,0,0,0,320,322,3,84,42,0,321,320,
		1,0,0,0,321,322,1,0,0,0,322,324,1,0,0,0,323,325,3,86,43,0,324,323,1,0,
		0,0,324,325,1,0,0,0,325,343,1,0,0,0,326,328,3,42,21,0,327,326,1,0,0,0,
		327,328,1,0,0,0,328,329,1,0,0,0,329,331,3,28,14,0,330,332,3,20,10,0,331,
		330,1,0,0,0,331,332,1,0,0,0,332,334,1,0,0,0,333,335,3,90,45,0,334,333,
		1,0,0,0,334,335,1,0,0,0,335,337,1,0,0,0,336,338,3,84,42,0,337,336,1,0,
		0,0,337,338,1,0,0,0,338,340,1,0,0,0,339,341,3,86,43,0,340,339,1,0,0,0,
		340,341,1,0,0,0,341,343,1,0,0,0,342,292,1,0,0,0,342,327,1,0,0,0,343,27,
		1,0,0,0,344,345,6,14,-1,0,345,346,3,30,15,0,346,361,1,0,0,0,347,348,10,
		2,0,0,348,350,5,119,0,0,349,351,7,2,0,0,350,349,1,0,0,0,350,351,1,0,0,
		0,351,352,1,0,0,0,352,360,3,28,14,3,353,354,10,1,0,0,354,356,7,3,0,0,355,
		357,7,2,0,0,356,355,1,0,0,0,356,357,1,0,0,0,357,358,1,0,0,0,358,360,3,
		28,14,2,359,347,1,0,0,0,359,353,1,0,0,0,360,363,1,0,0,0,361,359,1,0,0,
		0,361,362,1,0,0,0,362,29,1,0,0,0,363,361,1,0,0,0,364,370,3,32,16,0,365,
		366,5,1,0,0,366,367,3,26,13,0,367,368,5,2,0,0,368,370,1,0,0,0,369,364,
		1,0,0,0,369,365,1,0,0,0,370,31,1,0,0,0,371,373,3,42,21,0,372,371,1,0,0,
		0,372,373,1,0,0,0,373,374,1,0,0,0,374,376,5,137,0,0,375,377,3,88,44,0,
		376,375,1,0,0,0,376,377,1,0,0,0,377,379,1,0,0,0,378,380,3,38,19,0,379,
		378,1,0,0,0,379,380,1,0,0,0,380,381,1,0,0,0,381,383,3,34,17,0,382,384,
		3,36,18,0,383,382,1,0,0,0,383,384,1,0,0,0,384,386,1,0,0,0,385,387,3,50,
		25,0,386,385,1,0,0,0,386,387,1,0,0,0,387,388,1,0,0,0,388,390,3,52,26,0,
		389,391,3,80,40,0,390,389,1,0,0,0,390,391,1,0,0,0,391,405,1,0,0,0,392,
		393,5,137,0,0,393,398,3,48,24,0,394,395,5,6,0,0,395,397,3,48,24,0,396,
		394,1,0,0,0,397,400,1,0,0,0,398,396,1,0,0,0,398,399,1,0,0,0,399,402,1,
		0,0,0,400,398,1,0,0,0,401,403,3,50,25,0,402,401,1,0,0,0,402,403,1,0,0,
		0,403,405,1,0,0,0,404,372,1,0,0,0,404,392,1,0,0,0,405,33,1,0,0,0,406,411,
		3,48,24,0,407,408,5,6,0,0,408,410,3,48,24,0,409,407,1,0,0,0,410,413,1,
		0,0,0,411,409,1,0,0,0,411,412,1,0,0,0,412,35,1,0,0,0,413,411,1,0,0,0,414,
		415,5,110,0,0,415,420,3,114,57,0,416,417,5,6,0,0,417,419,3,114,57,0,418,
		416,1,0,0,0,419,422,1,0,0,0,420,418,1,0,0,0,420,421,1,0,0,0,421,37,1,0,
		0,0,422,420,1,0,0,0,423,427,5,104,0,0,424,427,5,109,0,0,425,427,3,40,20,
		0,426,423,1,0,0,0,426,424,1,0,0,0,426,425,1,0,0,0,427,39,1,0,0,0,428,429,
		5,109,0,0,429,430,5,65,0,0,430,431,5,1,0,0,431,436,3,142,71,0,432,433,
		5,6,0,0,433,435,3,142,71,0,434,432,1,0,0,0,435,438,1,0,0,0,436,434,1,0,
		0,0,436,437,1,0,0,0,437,439,1,0,0,0,438,436,1,0,0,0,439,440,5,2,0,0,440,
		41,1,0,0,0,441,443,5,145,0,0,442,444,5,133,0,0,443,442,1,0,0,0,443,444,
		1,0,0,0,444,445,1,0,0,0,445,450,3,44,22,0,446,447,5,6,0,0,447,449,3,44,
		22,0,448,446,1,0,0,0,449,452,1,0,0,0,450,448,1,0,0,0,450,451,1,0,0,0,451,
		43,1,0,0,0,452,450,1,0,0,0,453,458,3,114,57,0,454,455,5,1,0,0,455,456,
		3,46,23,0,456,457,5,2,0,0,457,459,1,0,0,0,458,454,1,0,0,0,458,459,1,0,
		0,0,459,460,1,0,0,0,460,461,5,49,0,0,461,462,5,1,0,0,462,463,3,26,13,0,
		463,464,5,2,0,0,464,45,1,0,0,0,465,470,3,116,58,0,466,467,5,6,0,0,467,
		469,3,116,58,0,468,466,1,0,0,0,469,472,1,0,0,0,470,468,1,0,0,0,470,471,
		1,0,0,0,471,47,1,0,0,0,472,470,1,0,0,0,473,488,5,20,0,0,474,475,3,10,5,
		0,475,478,5,130,0,0,476,479,3,114,57,0,477,479,3,74,37,0,478,476,1,0,0,
		0,478,477,1,0,0,0,479,481,1,0,0,0,480,482,3,24,12,0,481,480,1,0,0,0,481,
		482,1,0,0,0,482,488,1,0,0,0,483,485,3,140,70,0,484,486,3,24,12,0,485,484,
		1,0,0,0,485,486,1,0,0,0,486,488,1,0,0,0,487,473,1,0,0,0,487,474,1,0,0,
		0,487,483,1,0,0,0,488,49,1,0,0,0,489,492,5,120,0,0,490,493,3,10,5,0,491,
		493,5,165,0,0,492,490,1,0,0,0,492,491,1,0,0,0,493,496,1,0,0,0,494,495,
		5,114,0,0,495,497,3,10,5,0,496,494,1,0,0,0,496,497,1,0,0,0,497,51,1,0,
		0,0,498,500,3,54,27,0,499,501,3,72,36,0,500,499,1,0,0,0,500,501,1,0,0,
		0,501,503,1,0,0,0,502,504,3,68,34,0,503,502,1,0,0,0,503,504,1,0,0,0,504,
		506,1,0,0,0,505,507,3,70,35,0,506,505,1,0,0,0,506,507,1,0,0,0,507,53,1,
		0,0,0,508,509,5,58,0,0,509,514,3,56,28,0,510,511,5,6,0,0,511,513,3,56,
		28,0,512,510,1,0,0,0,513,516,1,0,0,0,514,512,1,0,0,0,514,515,1,0,0,0,515,
		55,1,0,0,0,516,514,1,0,0,0,517,521,3,62,31,0,518,520,3,64,32,0,519,518,
		1,0,0,0,520,523,1,0,0,0,521,519,1,0,0,0,521,522,1,0,0,0,522,57,1,0,0,0,
		523,521,1,0,0,0,524,525,5,1,0,0,525,530,3,142,71,0,526,527,5,6,0,0,527,
		529,3,142,71,0,528,526,1,0,0,0,529,532,1,0,0,0,530,528,1,0,0,0,530,531,
		1,0,0,0,531,533,1,0,0,0,532,530,1,0,0,0,533,534,5,2,0,0,534,59,1,0,0,0,
		535,536,5,142,0,0,536,541,3,58,29,0,537,538,5,6,0,0,538,540,3,58,29,0,
		539,537,1,0,0,0,540,543,1,0,0,0,541,539,1,0,0,0,541,542,1,0,0,0,542,61,
		1,0,0,0,543,541,1,0,0,0,544,547,3,10,5,0,545,546,5,114,0,0,546,548,3,10,
		5,0,547,545,1,0,0,0,547,548,1,0,0,0,548,550,1,0,0,0,549,551,3,24,12,0,
		550,549,1,0,0,0,550,551,1,0,0,0,551,593,1,0,0,0,552,555,5,19,0,0,553,554,
		5,114,0,0,554,556,3,10,5,0,555,553,1,0,0,0,555,556,1,0,0,0,556,558,1,0,
		0,0,557,559,3,24,12,0,558,557,1,0,0,0,558,559,1,0,0,0,559,593,1,0,0,0,
		560,563,5,165,0,0,561,562,5,114,0,0,562,564,3,10,5,0,563,561,1,0,0,0,563,
		564,1,0,0,0,564,566,1,0,0,0,565,567,3,24,12,0,566,565,1,0,0,0,566,567,
		1,0,0,0,567,593,1,0,0,0,568,569,5,1,0,0,569,570,3,26,13,0,570,572,5,2,
		0,0,571,573,3,24,12,0,572,571,1,0,0,0,572,573,1,0,0,0,573,593,1,0,0,0,
		574,577,3,116,58,0,575,576,5,114,0,0,576,578,3,10,5,0,577,575,1,0,0,0,
		577,578,1,0,0,0,578,580,1,0,0,0,579,581,3,24,12,0,580,579,1,0,0,0,580,
		581,1,0,0,0,581,593,1,0,0,0,582,583,5,1,0,0,583,584,3,60,30,0,584,586,
		5,2,0,0,585,587,3,24,12,0,586,585,1,0,0,0,586,587,1,0,0,0,587,593,1,0,
		0,0,588,590,3,142,71,0,589,591,3,24,12,0,590,589,1,0,0,0,590,591,1,0,0,
		0,591,593,1,0,0,0,592,544,1,0,0,0,592,552,1,0,0,0,592,560,1,0,0,0,592,
		568,1,0,0,0,592,574,1,0,0,0,592,582,1,0,0,0,592,588,1,0,0,0,593,63,1,0,
		0,0,594,596,3,66,33,0,595,594,1,0,0,0,595,596,1,0,0,0,596,597,1,0,0,0,
		597,598,5,121,0,0,598,599,3,62,31,0,599,600,5,65,0,0,600,601,3,140,70,
		0,601,620,1,0,0,0,602,604,3,66,33,0,603,602,1,0,0,0,603,604,1,0,0,0,604,
		605,1,0,0,0,605,606,5,121,0,0,606,607,3,62,31,0,607,608,5,71,0,0,608,609,
		5,1,0,0,609,614,3,116,58,0,610,611,5,6,0,0,611,613,3,116,58,0,612,610,
		1,0,0,0,613,616,1,0,0,0,614,612,1,0,0,0,614,615,1,0,0,0,615,617,1,0,0,
		0,616,614,1,0,0,0,617,618,5,2,0,0,618,620,1,0,0,0,619,595,1,0,0,0,619,
		603,1,0,0,0,620,65,1,0,0,0,621,627,5,118,0,0,622,624,7,4,0,0,623,625,5,
		129,0,0,624,623,1,0,0,0,624,625,1,0,0,0,625,627,1,0,0,0,626,621,1,0,0,
		0,626,622,1,0,0,0,627,67,1,0,0,0,628,629,5,116,0,0,629,630,5,52,0,0,630,
		635,3,140,70,0,631,632,5,6,0,0,632,634,3,140,70,0,633,631,1,0,0,0,634,
		637,1,0,0,0,635,633,1,0,0,0,635,636,1,0,0,0,636,69,1,0,0,0,637,635,1,0,
		0,0,638,639,5,117,0,0,639,640,3,140,70,0,640,71,1,0,0,0,641,642,5,143,
		0,0,642,643,3,140,70,0,643,73,1,0,0,0,644,646,5,1,0,0,645,647,3,114,57,
		0,646,645,1,0,0,0,646,647,1,0,0,0,647,649,1,0,0,0,648,650,3,76,38,0,649,
		648,1,0,0,0,649,650,1,0,0,0,650,652,1,0,0,0,651,653,3,78,39,0,652,651,
		1,0,0,0,652,653,1,0,0,0,653,654,1,0,0,0,654,655,5,2,0,0,655,75,1,0,0,0,
		656,657,5,131,0,0,657,658,5,52,0,0,658,663,3,140,70,0,659,660,5,6,0,0,
		660,662,3,140,70,0,661,659,1,0,0,0,662,665,1,0,0,0,663,661,1,0,0,0,663,
		664,1,0,0,0,664,77,1,0,0,0,665,663,1,0,0,0,666,667,5,128,0,0,667,668,5,
		52,0,0,668,673,3,22,11,0,669,670,5,6,0,0,670,672,3,22,11,0,671,669,1,0,
		0,0,672,675,1,0,0,0,673,671,1,0,0,0,673,674,1,0,0,0,674,79,1,0,0,0,675,
		673,1,0,0,0,676,677,5,144,0,0,677,682,3,82,41,0,678,679,5,6,0,0,679,681,
		3,82,41,0,680,678,1,0,0,0,681,684,1,0,0,0,682,680,1,0,0,0,682,683,1,0,
		0,0,683,81,1,0,0,0,684,682,1,0,0,0,685,686,3,116,58,0,686,687,5,49,0,0,
		687,688,3,74,37,0,688,83,1,0,0,0,689,690,5,127,0,0,690,692,3,140,70,0,
		691,693,7,5,0,0,692,691,1,0,0,0,692,693,1,0,0,0,693,85,1,0,0,0,694,696,
		7,6,0,0,695,697,7,7,0,0,696,695,1,0,0,0,696,697,1,0,0,0,697,698,1,0,0,
		0,698,700,3,140,70,0,699,701,7,5,0,0,700,699,1,0,0,0,700,701,1,0,0,0,701,
		703,1,0,0,0,702,704,7,8,0,0,703,702,1,0,0,0,703,704,1,0,0,0,704,87,1,0,
		0,0,705,706,5,139,0,0,706,707,5,162,0,0,707,89,1,0,0,0,708,709,5,124,0,
		0,709,710,3,140,70,0,710,91,1,0,0,0,711,712,5,146,0,0,712,713,3,94,47,
		0,713,714,5,149,0,0,714,719,3,96,48,0,715,716,5,6,0,0,716,718,3,96,48,
		0,717,715,1,0,0,0,718,721,1,0,0,0,719,717,1,0,0,0,719,720,1,0,0,0,720,
		723,1,0,0,0,721,719,1,0,0,0,722,724,3,72,36,0,723,722,1,0,0,0,723,724,
		1,0,0,0,724,93,1,0,0,0,725,727,3,10,5,0,726,728,3,24,12,0,727,726,1,0,
		0,0,727,728,1,0,0,0,728,736,1,0,0,0,729,732,5,165,0,0,730,731,5,114,0,
		0,731,733,3,10,5,0,732,730,1,0,0,0,732,733,1,0,0,0,733,736,1,0,0,0,734,
		736,3,116,58,0,735,725,1,0,0,0,735,729,1,0,0,0,735,734,1,0,0,0,736,95,
		1,0,0,0,737,738,3,116,58,0,738,739,5,23,0,0,739,740,3,140,70,0,740,97,
		1,0,0,0,741,742,5,147,0,0,742,743,5,120,0,0,743,745,3,100,50,0,744,746,
		3,102,51,0,745,744,1,0,0,0,745,746,1,0,0,0,746,747,1,0,0,0,747,748,3,104,
		52,0,748,99,1,0,0,0,749,757,3,10,5,0,750,753,5,165,0,0,751,752,5,114,0,
		0,752,754,3,10,5,0,753,751,1,0,0,0,753,754,1,0,0,0,754,757,1,0,0,0,755,
		757,3,116,58,0,756,749,1,0,0,0,756,750,1,0,0,0,756,755,1,0,0,0,757,101,
		1,0,0,0,758,759,5,1,0,0,759,764,3,116,58,0,760,761,5,6,0,0,761,763,3,116,
		58,0,762,760,1,0,0,0,763,766,1,0,0,0,764,762,1,0,0,0,764,765,1,0,0,0,765,
		767,1,0,0,0,766,764,1,0,0,0,767,768,5,2,0,0,768,103,1,0,0,0,769,772,3,
		26,13,0,770,772,3,60,30,0,771,769,1,0,0,0,771,770,1,0,0,0,772,105,1,0,
		0,0,773,774,5,103,0,0,774,775,3,140,70,0,775,107,1,0,0,0,776,777,5,150,
		0,0,777,778,3,10,5,0,778,109,1,0,0,0,779,780,5,151,0,0,780,785,3,112,56,
		0,781,782,5,154,0,0,782,784,3,112,56,0,783,781,1,0,0,0,784,787,1,0,0,0,
		785,783,1,0,0,0,785,786,1,0,0,0,786,790,1,0,0,0,787,785,1,0,0,0,788,789,
		5,153,0,0,789,791,3,124,62,0,790,788,1,0,0,0,790,791,1,0,0,0,791,111,1,
		0,0,0,792,793,3,140,70,0,793,794,5,152,0,0,794,795,3,124,62,0,795,113,
		1,0,0,0,796,800,5,160,0,0,797,800,5,161,0,0,798,800,5,15,0,0,799,796,1,
		0,0,0,799,797,1,0,0,0,799,798,1,0,0,0,800,115,1,0,0,0,801,805,3,114,57,
		0,802,804,3,118,59,0,803,802,1,0,0,0,804,807,1,0,0,0,805,803,1,0,0,0,805,
		806,1,0,0,0,806,810,1,0,0,0,807,805,1,0,0,0,808,810,3,114,57,0,809,801,
		1,0,0,0,809,808,1,0,0,0,810,117,1,0,0,0,811,812,5,7,0,0,812,830,3,114,
		57,0,813,814,5,11,0,0,814,819,3,142,71,0,815,816,5,6,0,0,816,818,3,142,
		71,0,817,815,1,0,0,0,818,821,1,0,0,0,819,817,1,0,0,0,819,820,1,0,0,0,820,
		822,1,0,0,0,821,819,1,0,0,0,822,823,5,12,0,0,823,830,1,0,0,0,824,825,5,
		11,0,0,825,826,5,10,0,0,826,827,3,142,71,0,827,828,5,12,0,0,828,830,1,
		0,0,0,829,811,1,0,0,0,829,813,1,0,0,0,829,824,1,0,0,0,830,119,1,0,0,0,
		831,832,5,1,0,0,832,837,3,140,70,0,833,834,5,6,0,0,834,836,3,140,70,0,
		835,833,1,0,0,0,836,839,1,0,0,0,837,835,1,0,0,0,837,838,1,0,0,0,838,840,
		1,0,0,0,839,837,1,0,0,0,840,841,5,2,0,0,841,121,1,0,0,0,842,843,5,79,0,
		0,843,844,5,165,0,0,844,123,1,0,0,0,845,849,5,51,0,0,846,848,5,9,0,0,847,
		846,1,0,0,0,848,851,1,0,0,0,849,847,1,0,0,0,849,850,1,0,0,0,850,852,1,
		0,0,0,851,849,1,0,0,0,852,857,3,2,1,0,853,854,5,9,0,0,854,856,3,2,1,0,
		855,853,1,0,0,0,856,859,1,0,0,0,857,855,1,0,0,0,857,858,1,0,0,0,858,863,
		1,0,0,0,859,857,1,0,0,0,860,862,5,9,0,0,861,860,1,0,0,0,862,865,1,0,0,
		0,863,861,1,0,0,0,863,864,1,0,0,0,864,866,1,0,0,0,865,863,1,0,0,0,866,
		867,5,55,0,0,867,125,1,0,0,0,868,869,5,53,0,0,869,870,5,1,0,0,870,871,
		3,142,71,0,871,872,5,49,0,0,872,873,3,138,69,0,873,874,5,2,0,0,874,127,
		1,0,0,0,875,880,5,50,0,0,876,881,5,91,0,0,877,878,5,92,0,0,878,879,5,93,
		0,0,879,881,3,142,71,0,880,876,1,0,0,0,880,877,1,0,0,0,881,129,1,0,0,0,
		882,884,5,94,0,0,883,885,3,142,71,0,884,883,1,0,0,0,884,885,1,0,0,0,885,
		889,1,0,0,0,886,888,3,132,66,0,887,886,1,0,0,0,888,891,1,0,0,0,889,887,
		1,0,0,0,889,890,1,0,0,0,890,894,1,0,0,0,891,889,1,0,0,0,892,893,5,153,
		0,0,893,895,3,140,70,0,894,892,1,0,0,0,894,895,1,0,0,0,895,896,1,0,0,0,
		896,897,5,55,0,0,897,131,1,0,0,0,898,899,5,98,0,0,899,900,3,140,70,0,900,
		901,5,152,0,0,901,902,3,140,70,0,902,133,1,0,0,0,903,976,5,77,0,0,904,
		976,5,78,0,0,905,906,5,73,0,0,906,908,5,1,0,0,907,909,7,9,0,0,908,907,
		1,0,0,0,908,909,1,0,0,0,909,911,1,0,0,0,910,912,5,165,0,0,911,910,1,0,
		0,0,911,912,1,0,0,0,912,914,1,0,0,0,913,915,5,58,0,0,914,913,1,0,0,0,914,
		915,1,0,0,0,915,916,1,0,0,0,916,917,3,142,71,0,917,918,5,2,0,0,918,976,
		1,0,0,0,919,920,5,97,0,0,920,921,5,1,0,0,921,922,5,165,0,0,922,923,5,59,
		0,0,923,924,3,142,71,0,924,925,5,2,0,0,925,976,1,0,0,0,926,927,5,96,0,
		0,927,928,5,1,0,0,928,929,3,136,68,0,929,930,5,58,0,0,930,931,3,142,71,
		0,931,932,5,2,0,0,932,976,1,0,0,0,933,934,5,95,0,0,934,935,5,1,0,0,935,
		940,3,140,70,0,936,937,5,6,0,0,937,939,3,140,70,0,938,936,1,0,0,0,939,
		942,1,0,0,0,940,938,1,0,0,0,940,941,1,0,0,0,941,943,1,0,0,0,942,940,1,
		0,0,0,943,944,5,2,0,0,944,976,1,0,0,0,945,946,5,99,0,0,946,947,5,1,0,0,
		947,948,5,165,0,0,948,949,5,59,0,0,949,950,3,142,71,0,950,951,5,2,0,0,
		951,976,1,0,0,0,952,953,5,100,0,0,953,954,5,1,0,0,954,955,5,165,0,0,955,
		956,5,59,0,0,956,957,3,142,71,0,957,958,5,2,0,0,958,976,1,0,0,0,959,960,
		5,101,0,0,960,961,5,1,0,0,961,962,5,165,0,0,962,963,5,59,0,0,963,964,3,
		142,71,0,964,965,5,2,0,0,965,976,1,0,0,0,966,967,5,102,0,0,967,968,5,1,
		0,0,968,969,5,165,0,0,969,970,5,59,0,0,970,971,3,142,71,0,971,972,5,145,
		0,0,972,973,5,165,0,0,973,974,5,2,0,0,974,976,1,0,0,0,975,903,1,0,0,0,
		975,904,1,0,0,0,975,905,1,0,0,0,975,919,1,0,0,0,975,926,1,0,0,0,975,933,
		1,0,0,0,975,945,1,0,0,0,975,952,1,0,0,0,975,959,1,0,0,0,975,966,1,0,0,
		0,976,135,1,0,0,0,977,978,7,10,0,0,978,137,1,0,0,0,979,980,7,11,0,0,980,
		139,1,0,0,0,981,982,6,70,-1,0,982,1014,3,144,72,0,983,1014,3,126,63,0,
		984,1014,3,134,67,0,985,1014,3,10,5,0,986,1014,3,130,65,0,987,1014,3,116,
		58,0,988,989,5,1,0,0,989,990,3,140,70,0,990,991,5,2,0,0,991,1014,1,0,0,
		0,992,993,5,1,0,0,993,994,3,26,13,0,994,995,5,2,0,0,995,1014,1,0,0,0,996,
		997,7,12,0,0,997,1014,3,140,70,17,998,999,5,56,0,0,999,1000,5,1,0,0,1000,
		1001,3,26,13,0,1001,1002,5,2,0,0,1002,1014,1,0,0,0,1003,1004,3,142,71,
		0,1004,1005,7,13,0,0,1005,1006,7,14,0,0,1006,1007,5,1,0,0,1007,1008,3,
		26,13,0,1008,1009,5,2,0,0,1009,1014,1,0,0,0,1010,1011,5,63,0,0,1011,1014,
		3,140,70,2,1012,1014,3,124,62,0,1013,981,1,0,0,0,1013,983,1,0,0,0,1013,
		984,1,0,0,0,1013,985,1,0,0,0,1013,986,1,0,0,0,1013,987,1,0,0,0,1013,988,
		1,0,0,0,1013,992,1,0,0,0,1013,996,1,0,0,0,1013,998,1,0,0,0,1013,1003,1,
		0,0,0,1013,1010,1,0,0,0,1013,1012,1,0,0,0,1014,1083,1,0,0,0,1015,1016,
		10,18,0,0,1016,1017,5,29,0,0,1017,1082,3,140,70,19,1018,1019,10,16,0,0,
		1019,1020,7,15,0,0,1020,1082,3,140,70,17,1021,1022,10,15,0,0,1022,1023,
		7,16,0,0,1023,1082,3,140,70,16,1024,1025,10,14,0,0,1025,1026,7,12,0,0,
		1026,1082,3,140,70,15,1027,1028,10,13,0,0,1028,1029,7,13,0,0,1029,1082,
		3,140,70,14,1030,1032,10,12,0,0,1031,1033,5,63,0,0,1032,1031,1,0,0,0,1032,
		1033,1,0,0,0,1033,1034,1,0,0,0,1034,1035,5,61,0,0,1035,1082,3,140,70,13,
		1036,1038,10,11,0,0,1037,1039,5,63,0,0,1038,1037,1,0,0,0,1038,1039,1,0,
		0,0,1039,1040,1,0,0,0,1040,1041,5,138,0,0,1041,1042,5,69,0,0,1042,1082,
		3,140,70,12,1043,1045,10,8,0,0,1044,1046,5,63,0,0,1045,1044,1,0,0,0,1045,
		1046,1,0,0,0,1046,1047,1,0,0,0,1047,1048,5,106,0,0,1048,1049,3,142,71,
		0,1049,1050,5,48,0,0,1050,1051,3,140,70,9,1051,1082,1,0,0,0,1052,1053,
		10,5,0,0,1053,1054,5,48,0,0,1054,1082,3,140,70,6,1055,1056,10,4,0,0,1056,
		1057,5,67,0,0,1057,1082,3,140,70,5,1058,1059,10,26,0,0,1059,1060,5,32,
		0,0,1060,1082,3,138,69,0,1061,1062,10,25,0,0,1062,1082,3,128,64,0,1063,
		1065,10,10,0,0,1064,1066,5,63,0,0,1065,1064,1,0,0,0,1065,1066,1,0,0,0,
		1066,1067,1,0,0,0,1067,1068,5,59,0,0,1068,1082,3,120,60,0,1069,1071,10,
		9,0,0,1070,1072,5,63,0,0,1071,1070,1,0,0,0,1071,1072,1,0,0,0,1072,1073,
		1,0,0,0,1073,1074,5,59,0,0,1074,1082,3,26,13,0,1075,1076,10,3,0,0,1076,
		1078,5,60,0,0,1077,1079,5,63,0,0,1078,1077,1,0,0,0,1078,1079,1,0,0,0,1079,
		1080,1,0,0,0,1080,1082,5,64,0,0,1081,1015,1,0,0,0,1081,1018,1,0,0,0,1081,
		1021,1,0,0,0,1081,1024,1,0,0,0,1081,1027,1,0,0,0,1081,1030,1,0,0,0,1081,
		1036,1,0,0,0,1081,1043,1,0,0,0,1081,1052,1,0,0,0,1081,1055,1,0,0,0,1081,
		1058,1,0,0,0,1081,1061,1,0,0,0,1081,1063,1,0,0,0,1081,1069,1,0,0,0,1081,
		1075,1,0,0,0,1082,1085,1,0,0,0,1083,1081,1,0,0,0,1083,1084,1,0,0,0,1084,
		141,1,0,0,0,1085,1083,1,0,0,0,1086,1087,6,71,-1,0,1087,1101,3,144,72,0,
		1088,1101,3,126,63,0,1089,1101,3,128,64,0,1090,1101,3,134,67,0,1091,1101,
		3,10,5,0,1092,1101,3,130,65,0,1093,1101,3,116,58,0,1094,1095,5,1,0,0,1095,
		1096,3,142,71,0,1096,1097,5,2,0,0,1097,1101,1,0,0,0,1098,1099,7,12,0,0,
		1099,1101,3,140,70,0,1100,1086,1,0,0,0,1100,1088,1,0,0,0,1100,1089,1,0,
		0,0,1100,1090,1,0,0,0,1100,1091,1,0,0,0,1100,1092,1,0,0,0,1100,1093,1,
		0,0,0,1100,1094,1,0,0,0,1100,1098,1,0,0,0,1101,1119,1,0,0,0,1102,1103,
		10,4,0,0,1103,1104,5,29,0,0,1104,1118,3,142,71,5,1105,1106,10,3,0,0,1106,
		1107,7,16,0,0,1107,1118,3,142,71,4,1108,1109,10,2,0,0,1109,1110,7,12,0,
		0,1110,1118,3,142,71,3,1111,1112,10,1,0,0,1112,1113,7,13,0,0,1113,1118,
		3,142,71,2,1114,1115,10,12,0,0,1115,1116,5,32,0,0,1116,1118,3,138,69,0,
		1117,1102,1,0,0,0,1117,1105,1,0,0,0,1117,1108,1,0,0,0,1117,1111,1,0,0,
		0,1117,1114,1,0,0,0,1118,1121,1,0,0,0,1119,1117,1,0,0,0,1119,1120,1,0,
		0,0,1120,143,1,0,0,0,1121,1119,1,0,0,0,1122,1132,5,162,0,0,1123,1132,5,
		163,0,0,1124,1132,5,164,0,0,1125,1132,5,166,0,0,1126,1132,5,165,0,0,1127,
		1132,5,70,0,0,1128,1132,5,57,0,0,1129,1132,5,64,0,0,1130,1132,3,122,61,
		0,1131,1122,1,0,0,0,1131,1123,1,0,0,0,1131,1124,1,0,0,0,1131,1125,1,0,
		0,0,1131,1126,1,0,0,0,1131,1127,1,0,0,0,1131,1128,1,0,0,0,1131,1129,1,
		0,0,0,1131,1130,1,0,0,0,1132,145,1,0,0,0,146,149,157,163,178,187,190,195,
		204,207,211,216,220,229,232,241,246,255,271,276,282,285,289,292,296,299,
		303,306,309,312,315,318,321,324,327,331,334,337,340,342,350,356,359,361,
		369,372,376,379,383,386,390,398,402,404,411,420,426,436,443,450,458,470,
		478,481,485,487,492,496,500,503,506,514,521,530,541,547,550,555,558,563,
		566,572,577,580,586,590,592,595,603,614,619,624,626,635,646,649,652,663,
		673,682,692,696,700,703,719,723,727,732,735,745,753,756,764,771,785,790,
		799,805,809,819,829,837,849,857,863,880,884,889,894,908,911,914,940,975,
		1013,1032,1038,1045,1065,1071,1078,1081,1083,1100,1117,1119,1131
	};

	public static readonly ATN _ATN =
		new ATNDeserializer().Deserialize(_serializedATN);


}
} // namespace QueryCat.Backend.Parser
